tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37054] New: - NoClassDefFoundError using ServletContextListener
Date Wed, 12 Oct 2005 16:46:38 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37054>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37054

           Summary: NoClassDefFoundError using ServletContextListener
           Product: Tomcat 5
           Version: 5.5.12
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ehcapa.allizgub@elsen.net


Since 5.5.12 using a ServletContextListener leads to a NoClassDefFoundError.
5.5.11 instead worked as expected with exactly the same code.

The class ServletListener is part of the web application. The web application of
course has no servlet-api.jar included as this must be provided by the servlet
engine through the appropriate classloader.

o JVM is Sun 1.5.0_05, I got the same error with 1.5.0_04.

o My web.xml:
<web-app>
   ...
    <listener>
        <listener-class>
        this.is.my.ServletListener
        </listener-class>
    </listener>   
</web-app>

o My listener class:
public class ServletListener implements ServletContextListener {
        public void contextInitialized(ServletContextEvent arg0) {...}
        public void contextDestroyed(ServletContextEvent arg0) {…}
}

o This is the error during startup:
09:09:12,579 ERROR [/myApp]:3643 - Error configuring application listener of
class this.is.my.ServletListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:870)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1305)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3640)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:680)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:536)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
09:09:12,594 ERROR [/myApp]:3650 - Skipped installing application listeners due
to previous error(s)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message