Recently want to see the source of spring, under the source, build a simple example of hellospring Web project, using the project relies on the use of the source of the class. Set up and start the Tomcat report java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet error. Refer to the following article.
The benefit of replacing a jar with a dependent project (Required projects) in eclipse is that you can change the code in the dependent project at any time and refer to the latest compilation class in the main project. This approach is very useful when debugging, avoiding the hassle of packaging a jar after each modification of the dependent package source code, and constantly updating the main project jar package. Such project references are very common in open-source projects.
1. Delete the corresponding jar file in the main project, such as: Framework.jar.
2. Right-click the project->properties->java Build path->projects->add and select the dependent project, such as: Framework->ok (Save Settings) to this step, Your master project will compile without errors, and the class that has the error to delete the jar file will compile correctly.
3. If your project is a Web project and you need to deploy debugging, you must also make the following settings: Right-click Project->properties->deployment assmebly->add, select Projects, select the Target project framework Save.
This will also be dependent on the project release at the time of the main project release. Otherwise, although it compiles successfully, it will error when publishing to the server: ClassNotFound.
How to use dependent projects in Eclipse (Required projects) instead of Jars