Bug 40272

Summary: classloader definition in server.xml is not properly parsed
Product: Tomcat 5 Reporter: Costin Leau <costin.leau>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 5.5.17   
Target Milestone: ---   
Hardware: Other   
OS: Windows XP   

Description Costin Leau 2006-08-17 07:43:16 UTC
When defining a classloader (custom or standard) inside the server.xml,
configuration is not properly read and it fails.
Example of server.xml:

<Host>
..
      <Context path="petclinic" docBase="petclinic" reloadable="false">
      	<Loader loaderClass="org.apache.catalina.loader.WebappClassLoader"/>
      </Context>
...
</Host>

The webapp (petclinic in this case) will fail with the following error:

SEVERE: Error configuring application listener of class
org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)


No matter what classloader is specified (a custom or an official one) the
exception will appear. Removing the Loader tag, makes the application load properly.
Comment 1 Costin Leau 2006-08-17 07:44:03 UTC
The bug is similar to http://issues.apache.org/bugzilla/show_bug.cgi?id=39704
Comment 2 Mark Thomas 2006-08-22 01:44:18 UTC
Although the error messages differ, this is in fact a duplicate. The problem is
that the parent clasloader is not set so any classes that should be loaded from
the shared classloader or higher fail.

*** This bug has been marked as a duplicate of 39704 ***