Bug 55287 - ServletContainerInitializer in parent classloader may not be found
Summary: ServletContainerInitializer in parent classloader may not be found
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: All All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Blocks: 55312
  Show dependency tree
Reported: 2013-07-21 20:44 UTC by Jeremy Boynes
Modified: 2014-01-15 13:09 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Boynes 2013-07-21 20:44:47 UTC
To include the JasperInitializer in the test environment I added an entry in testclasses/META-INF/services. This is not picked up when the parent classloader is searched because this path is a directory not a JAR file. 

It would be picked up if the "scanAllDirectories" extension was enabled but that should not be necessary if the search is to be semantically equivalent to j.u.ServiceLoader (which does locate it).
Comment 1 Jeremy Boynes 2013-07-21 20:53:23 UTC
Looking at StandardJarScanner, it also only looks for services where the ClassLoader is a URLClassLoader whereas j.u.ServiceLoader basically uses getResources() on the supplied ClassLoader.
Comment 2 Jeremy Boynes 2013-07-29 00:14:56 UTC
Fixed in trunk: http://svn.apache.org/r1507870
Comment 3 Mark Thomas 2014-01-15 13:09:14 UTC
This has also been fixed in 7.0.x for 7.0.51 onwards.