场景:同一个tomcat下部署多个java工程。
问题现象: 启动tomcat时报异常Singleton bean creation not allowed while the singletons of this factory are in destruction
问题原因:不同的工程分别创建了同一个单例。
处理方案:1、在应用的web.xml文件中,配置不同的webAppRootKey,<param-value>值可以自定义,只要相同tomcat下的各个工程保持不同即可。
- <context-param>
- <param-name>webAppRootKey</param-name>
- <param-value>web.sample.root</param-value>
- </context-param>