During the recent project development and testing, it was found that the project was repeatedly loaded during Tomcat startup, resulting in two Resource Initialization problems. Cause: For example, when you set server locations to "use tomcat installation (takes control of Tomcat installation)" In eclipse, This will cause this problem!
Root cause:
Solution 1: Delete the context in server. xml
However, this causes a problem: In web modules, you will not be able to see our project
Solution 2: create a directory under the Tomcat directory, for example, "webroot"
Modify server. in XML, the appbase of the host is specified as the newly created directory "webroot", while the context directory uses the relative directory ".. /webapps/MyApp-web. Note: The project name "MyApp-web" must be included later"
In fact, the simplest thing is not to modify"Server locations "configuration!
When Tomcat is started, the project is loaded repeatedly, causing two Resource Initialization problems.