Bug 40272 - classloader definition in server.xml is not properly parsed
Summary: classloader definition in server.xml is not properly parsed
Status: RESOLVED DUPLICATE of bug 39704
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.17
Hardware: Other Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-17 07:43 UTC by Costin Leau
Modified: 2006-08-21 18:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***