tomcat部署多工程Singleton bean creation not allowed while the singletons of this factory are in destructi

来源:互联网 发布:怎样属于数组下标越界 编辑:程序博客网 时间:2024/06/10 12:41

场景:同一个tomcat下部署多个java工程。

问题现象: 启动tomcat时报异常Singleton bean creation not allowed while the singletons of this factory are in destruction

问题原因:不同的工程分别创建了同一个单例。

处理方案:1、在应用的web.xml文件中,配置不同的webAppRootKey,<param-value>值可以自定义,只要相同tomcat下的各个工程保持不同即可。

  1. <context-param>  
  2.   <param-name>webAppRootKey</param-name>  
  3.   <param-value>web.sample.root</param-value>  
  4. </context-param>  

阅读全文
0 0
原创粉丝点击