Why does my servlet give a 404 error?
There are many reasons why a servlet container may issue an HTTP 404 error for a servlet. You should check you have added a servlet configuration and mapping to your web.xml file and make sure you are requesting the URL path specified in the mapping. If your servlet compiles successfully, another possibility is that it throws a ServletException in the init(ServletConfig) method. If so, the servlet container will log the exception and take the servlet out of service. Check your log files for any details. Actions: Follow-up, clarify or correct this answer. Submit a new question.
Related Questions
- When I try to startup Apache JServ I get an error message starting with "java.lang.NoClassDefFoundError: javax/servlet/...". Whats wrong?
- I get a server error "500 Internal Servler Error" from the adapters servlet. What went wrong?
- Why do I get an Error 500 when I try and run the servlet under WebSphere?