flowcontrol
Programmer
I'm coming back to a project after not working on it for several weeks. I created a new servlet for my web-app and "registered" it in the app's deployment descriptor. I reloaded the app using Tomcat Manager. When I try to invoke the servlet, I get a NoClassDefFound exception. The class exists, so I'm thinking that maybe two different class loaders are involved and thus one class can't find the other. But, that's just a WAG. I was running tomcat with -Dsecurity.manager when the error occurred, but I took that out (and still get the error). Does anybody have ANY ideas??
Here is part of the error message:
Here is the deployment descriptor (I used different tokens for servlet-name, servlet-class, and servlet-mapping to make it clear what the error message was referring to):
Here is part of the error message:
Code:
[b]exception[/b]
javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
...
[b]root cause[/b]
java.lang.NoClassDefFoundError: com/mycompany/dept/MyStats (wrong name: MyStats)
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:539)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
Code:
<servlet>
<servlet-name>
Stats
</servlet-name>
<servlet-class>
com.mycompany.dept.MyStats
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
Stats
</servlet-name>
<url-pattern>
/GetStats
</url-pattern>
</servlet-mapping>