The idea configured in tomcat7 (tomcat8 start our project there will be problems, for unknown reasons)
Then start tomcat project, after a successful start, and went again to start the process
After completion of the equivalent of start and restart, this is not what started twice;
The first thing I thought was different projects tomcat configuration when multiple tomcat instances due to space;
It has been tested and found not half dime
Then I thought of the environment variable, do not repeat the configuration ??
The reason to check it again, not the environment variable
Then I thought about the recent two-day configuration and operation and found no problem ah
Bold hypothesis, A careful
So keep looking, because there is definitely a two tomcat start two instances in which I have encountered again eclipse
Then continue to read tomcat configuration, see the environment variables here
Because I had configured the CATALINA_HOME and CATALINA_BASE (as shown below) in the computer system environment variables
This in turn configured here debug environment variables CATALINA_HOME and a CATALINA_BASE in tomcat, will not lead to a repeat start twice (as shown below)
In order to make a comparison experiment, tomcat run there is no configuration environment variable
Then the start of the experiment
First debug start tomcat, the project started twice
Then start tomcat directly run, a project launched
By comparing the experiment proved entirely correct guess, then modify the startup OK
Want to help you if you have any questions, please leave a message comments section!
update by 2019.11.28
Appeared twice to start the project, asked about his colleagues, he also appeared in such a situation;
The original project was put in a bag war, leading to restart twice;
But why become once, twice today suddenly changed after the last time;
This will always be a mystery!
update by 2019.12.06
The last issue came out, and today is operating the meal fierce as a tiger
① delete environment variables CATALINA_HOME and CATALINA_BASE
② then the idea configured tomcat startup time there also scratched
③ Later, the idea C disk directory under tomcat tomcat also removed the
(中间从2018.3升级到了2019.2,所以存在两个目录;一开始只删除了上面的,后来索性将下面的也删除掉了)
切记,删除之前一定要做备份,切记切记切记,重三遍!!!
④再后来将webapps下的项目也移到了tomcat之外
D:\utils\apache-tomcat-7.0.96-idea ---- tomcat路径
D:\utils\ROOT ---- 项目路径
这样项目再次启动日志就只打印了一次
由于③和④同时操作的,感觉应该是④的原因;
因为我直接用tomcat bin目录下的startup.bat启动,日志也是打印两遍,所以跟idea基本上撇清关系了;
可是同事的tomcat带项目都是我拷过去的,也是用idea通过外部tomcat启动的就没有问题;
反正遇到问题就一顿操作,总会好的;
最后希望能够帮到您!!
如有问题请留言下方,个人见解,谨慎借鉴!