Tomcat jar loading
I have created a web app in GWT and deployed it in Tomcat. I need to separate out some jars(Third party jars) from WEB-INF/lib and place them in a folder outside Tomcat setup. Pl开发者_如何转开发ease help me as of how to make appropriate changes so that on starting tomcat server those third party jars are loaded.
In Tomcat6, you can place shared jars in $CATALINA_HOME/lib
and it will be visible to all the web apps.
As the docs clearly state,
Therefore, from the perspective of a web application, class or resource loading looks in the following repositories, in this order:
Bootstrap classes of your JVM
System class loader classes (described above)
/WEB-INF/classes of your web application
/WEB-INF/lib/*.jar of your web application
$CATALINA_HOME/lib
$CATALINA_HOME/lib/*.jar
So if you have the same jar within your web-inf/lib, it will get loaded from there first. Ensure you remove duplicates.
精彩评论