I looked at tomcat 8  source code to determine how the class loader resolves
libraries and class folders specified in post resources.

if the order of post resources is as follows

<PostResources base="D:\Projects\external\classes"
className="org.apache.catalina.webresources.DirResourceSet"
webAppMount="/WEB-INF/classes"/>

<PostResources base="D:\Projects\lib\library1.jar"
className="org.apache.catalina.webresources.FileResourceSet"
webAppMount="/WEB-INF/lib/library1.jar"/>

then the class loader looks for classes in library1.jar before it looks for
classes in D:\Projects\external\classes

which seems counterintuitive.

I worked around this issue by specifying PostResources as follows.

<PostResources base="D:\Projects\external\classes"
className="org.apache.catalina.webresources.DirResourceSet"
webAppMount="/WEB-INF/classes"/>

<PostResources base="D:\Projects\lib\library1.jar"
className="org.apache.catalina.webresources.JarResourceSet"
webAppMount="/WEB-INF/classes"/>

Do you think my issue is valid, or I just have to configure resources the
way I showed above to get correct ordering when resolving classes?




--
View this message in context: 
http://tomcat.10.x6.nabble.com/Tomcat-8-5-Regarding-PostResources-for-Web-Inf-lib-and-Web-Inf-classes-tp5053929p5054690.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to