-2

I am getting this error while running my servlet program .Can anyone let me know why I m getting this error

        java.lang.ClassCastException:org.apache.catalina.core.ApplicationDispatcher cannot be cast to org.apache.catalina.servlet4preview.RequestDispatcher
        net.codejava.HelloServlet.doGet(HelloServlet.java:35)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

1 Answers1

0

This can happen when you have Tomcat-specific JAR files in your webapp's /WEB-INF/lib. This is not right. You should remove all servletcontainer-specific JAR files from there. They do not belong there at all. They are supposed to be already provided by the servletcontainer itself. The /WEB-INF/lib should only contain libraries specific to the webapp itself which are not provided by the servletcontainer.