Rupert Madden-Abbott created MTOMCAT-303:
--------------------------------------------
Summary: Tomcat 8: Jar classes override project classes
Key: MTOMCAT-303
URL: https://issues.apache.org/jira/browse/MTOMCAT-303
Project: Apache Tomcat Maven Plugin
Issue Type: Bug
Reporter: Rupert Madden-Abbott
Fix For: 3.0
Firstly, there is no tomcat8 component in JIRA so I'm having to put "Tomcat 8"
in the title for these tickets as there is no other way to distinguish them.
When the same class exists in both a jar dependency, and a web application,
then Tomcat should load the version in the web application over the version in
the jar, as documented here:
https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html
However, when executing the "run" goal, it appears that the jar class will get
loaded, in favour of any that is compiled with the web application itself.
In particular, this occurs when using Class.forName() which triggers
getClassLoaderResources on line 420 of
org.apache.tomcat.maven.plugin.tomcat8.run.RunMojo. However, this method will
attempt to fetch the resource using a UrlClassLoader which has been configured,
on line 356, to only use jar paths.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]