Tomcat 6 vs 7 - lib vs shared / lib - jars only? [英] Tomcat 6 vs 7 - lib vs shared/lib - jars only?
问题描述
从Tomcat 6升级到Tomcat 7时 - 我们在6上的$ CATALINA_HOME / lib目录中保留了我们想要的类路径上的一些文件 - 在Tomcat 7上移动这两个$ CATALINA_HOME / shared / lib是有意义的。
我们发现jar文件已经过了 - 但是任何不是jar文件的东西 - 例如xml文件等都没有被在shared / lib目录中加载的类。当我们将非jar文件移回$ CATALINA_HOME / lib目录时 - 它们加载到类路径中而没有问题。
我的问题是 - 这是Tomcat 7中类加载器中的错误吗?或者这是预期的行为吗?(未能将$ jar文件从$ CATALINA_HOME / shared / lib加载到类路径中,其方式与从$ CATALINA_HOME / lib加载文件的方式不一致)
操作系统:Windows7
Tomcat版本:7.0.30
Java版本:1.7.0_11
请注意,Tomcat 6.0.14 $ CATALINA_HOME / shared / lib目录不存在
。
你需要添加这个,你需要编辑
$ CATALINA_HOME / conf / catalina.properties,以便shared.loader行
看起来像这样shared.loader = $ CATALINA_HOME / shared / lib
When upgrading from Tomcat 6 to Tomcat 7 - we kept a number of files we wanted on the classpath in the $CATALINA_HOME/lib directory on 6 - and it made sense to move these two $CATALINA_HOME/shared/lib on Tomcat 7.
What we've found is that the jar files went across ok - but anything that wasn't a jar file - eg an xml file etc was not picked up by the class loaded in the shared/lib directory. When we moved the non-jar files back to the $CATALINA_HOME/lib directory - they loaded into the classpath without an issue.
My question is - is this a bug in the classloader in Tomcat 7? Or is this intended behaviour? (Failing to load non-jar files onto the classpath from the $CATALINA_HOME/shared/lib in a manner inconsistent to that which loads files from $CATALINA_HOME/lib)
OS: Windows7
Tomcat version: 7.0.30
Java version: 1.7.0_11
I don't use shared lib, but according to this doc: http://wiki.apache.org/tomcat/HowTo
Note that Tomcat 6.0.14 the $CATALINA_HOME/shared/lib directory does not exist.
You will need to add this and you will need to edit $CATALINA_HOME/conf/catalina.properties so that the shared.loader line looks like this shared.loader=$CATALINA_HOME/shared/lib
这篇关于Tomcat 6 vs 7 - lib vs shared / lib - jars only?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!