java web error:Choose unique values for the 'webAppRootKey'

使用tomcat部署了两个app,发现始终有一个默认启动不起来。从tomcat日志中有了发现。

日志信息:

四月 19, 2016 9:09:55 上午 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class ch.qos.logback.ext.spring.web.LogbackConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [D:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\appA\] instead of [D:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\appB\] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:148)
at ch.qos.logback.ext.spring.web.WebLogbackConfigurer.initLogging(Unknown Source)
at ch.qos.logback.ext.spring.web.LogbackConfigListener.contextInitialized(Unknown Source)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

搜了网上同仁的解决方法:

修改web.xml,两个app使用不同的webAppRootKey值。重启应用发现应用都起来了。

<context-param>
<param-name>webAppRootKey</param-name>
<param-value>webName.root</param-value>
</context-param>

 

posted @ 2016-04-19 10:15  sdjnfangjx  阅读(581)  评论(0编辑  收藏  举报