Again, please stop top posting. On 18/02/2014 10:14, Romain Manni-Bucau wrote: > let say we have an interface Foo. I deploy a war with Foo and FooImpl. > In the since I'm in embedded mode I can get FooImpl casting it to Foo. > Foo has been loaded from the Junit JVM for instance and FooImpl from > the webapp cause we use a framework (spring, CDI, ...). The cast will > fail cause FooImpl will use Foo from the webapp.
In which case you need either: a) Have Foo treated as a Java SE provided class. Adding the JAR containing Foo to the endorsed dir rather than the class path should work. b) Have Foo treated as a container provided class and filter it out via WebappClassLoader.filter(String) > It was working fine before and it was convenient. By default you don't > add jars in tomcat system loader so the behavior of tomcat was fine + > in unit test of embedded mode it was convenient so I dont get the > point changing it. The point of changing it was: - fixing the reported bug - have the actual behaviour align with the documented / spec required behaviour There was nothing in either the spec or the docs that required Tomcat to prevent web applications overridding a class on the system class path. Switching to using the endorsed dir looks like the simplest solution to me and it should work for Tomcat versions before and after the BZ 55943 change. Other possible solutions include: - removing the final from j2seClassLoader / always accessing it via an over-ridable getter() (I'd recommend checking that that will work for you as the other related changes may also cause problems) - making it possible to add to the packages used to define the filter for container classes Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org