java.lang.ClassNotFoundException for servlet in tomcat with eclipse
This question already has an answer here:
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).
下一篇: 用于eclipse的tomcat中的servlet的java.lang.ClassNotFoundException