java.lang.ClassNotFoundException: HttpServletRequest

Your web app has servlet container specific libraries like servlet-api.jar file in its /WEB-INF/lib. This is not right. Remove them all. The /WEB-INF/lib should contain only the libraries specific to the Web app, not to the servlet container. The servlet container (like Tomcat) is the one who should already provide the servlet container specific libraries. If you supply libraries from an arbitrary servlet container of a different make/version, you’ll run into this kind of problems, as your web app wouldn’t be able to run on a servlet container of a different make/version than those libraries originated from.

This is a pretty common starter’s mistake when they encounter compile-time errors, as they haven’t set up their IDE project right. See also How do I import the javax.servlet API in my Eclipse project?

Leave a Comment