java.lang.ClassNotFoundException for servlet in tomcat with eclipse

This question already has an answer here:

  • Servlet returns “HTTP Status 404 The requested resource (/servlet) is not available” 1 answer

  • Sometimes on creating of filters or servlets, the class file is not generated in build folder in eclipse.Clean the application and build it once, a .class file is generated in that above said path. This removes class not found error in some cases.


    it is a maven project? in maven projects src/test is the location for unit tests and is excluded from build and war, try change the package name and try again.


    Looks like youre building a Maven-based project, and you're putting your class on the wrong location

    You should use src/main/java to put your classes, and src/test/java to put your tests on it (ie, JUnit tests, if you have any).

    链接地址: http://www.djcxy.com/p/23320.html

    上一篇: 调试Java servlet中的init()方法

    下一篇: 用于eclipse的tomcat中的servlet的java.lang.ClassNotFoundException