Googled everything, but can’t find solution for my problem.
When i’m trying to deploy my project to Tomcat, i have such errors in Tomcat log:
SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener
I tried to deploy it from fresh Netbeans 6.8 to fresh Tomcat 6.0.26, but the problem is still there.
Servlet-api.jar is in the tomcat/lib folder. Tried to replace it with the newest, but problem is still there.
No compilation errors. Everything is correct.
Problem started suddenly. No code changes, no new jars added.
Help?
UPD: contents of WEB-INF/lib:
- hibernate3.jar
- hibernate-testing.jar
- quartz-1.7.2.jar
- quartz-all-1.7.2
- servlet-api-2.5-20081211
The
javax.servlet.ServletRequestListeneris newly introduced since Servlet 2.4 API. That your environment cannot seem to find it can be caused by two things:Either the
web.xmlis declared as Servlet 2.3 or older which forces the server to Servlet 2.3 compliance mode, or the server in question doesn’t support Servlet 2.4 at all.Classpath is really, really messed up. You should never put/change/remove libraries in
JRE/lib,JRE/lib/extorTomcat/libwithout understanding what you’re doing. You should never put appserver-specific libraries inWebapp/WEB-INF/libbecause that doesn’t make any sense.To fix 1, ensure that your
web.xmlis declared as at least Servlet 2.4. Preferably the newest which the server can support. Tomcat 6.0 supports Servlet 2.5, so declareweb.xmlaccordingly.To fix 2, cleanup the classpath of all pollution. Invest some more time to learn more about the phenomeon “classpath”. Handle it with care.