java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [....\tmp1\wtpwebapps\workreport\] instead of [.....\wtpwebapps\ApprovalFront\]
- Choose unique values for the 'webAppRootKey' context-param in your web.xml files! at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:150) at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:116) at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)
Tomcat发布多个项目时抛的webAppRootKey错误, 原因是部署在同一容器中的Web项目,定义了相同的webAppRootKey或者都没有定义
解决办法:需要为每个web都定义一个webAppRootKey
<!--app1中的web.xml--> <context-param> <param-name>webAppRootKey</param-name> <param-value>app1.root</param-value> </context-param> <!--app2中的web.xml--> <context-param> <param-name>webAppRootKey</param-name> <param-value>app2.root</param-value> </context-param>