August 2, 2009

Servlets: java.lang.ClassNotFoundException

 

Topic:  Servlets 2.4

Application Server: JBoss 4.0.2

Exception:

javax.servlet.ServletException: Wrapper cannot find servlet class com.HelloWorldServle or a class it depends on
 org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
 org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
 java.lang.Thread.run(Thread.java:619)
java.lang.ClassNotFoundException: com.HelloWorldServle
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
 org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
 org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
 java.lang.Thread.run(Thread.java:619)

Resolution:

The Servlet class name in the web.xml file is incorrect. Make sure the package name and the class name in the <servlet-class> element are exact, including the case.

No comments:

Post a Comment