Project error java.lang.ClassNotFoundException: org.common.SessionListener

Phenomenon: The project reports an error of java.lang.ClassNotFoundException: org.common.SessionListener, and there are more classes folders displayed under the WEB-INF of the project directory in the Package Explorer on the left side of myeclipse. Since the error is ClassNotFoundException, go to tomcat's WEB-INF/classes to find the project, there is indeed no class file.

Solution: Right-click the project, click properties, and open the Java Build Path:

You can see that the Default output folder in the figure is under "project name/bin", go to the workspace to find the project, and see that there is indeed a bin directory under the project, which contains class files... It seems that it is generated after deployment The class files are all here. Therefore, the solution is to change the path in the above figure to "project name/WebRoot/WEB-INF/classes". After the modification, delete all the class files in the bin directory before, it should not be here. Then redeploy. After the deployment is successful, go to the classes file of tomcat and see that the class file has been generated. Restart the project at this point, success!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324687007&siteId=291194637