java.lang.IllegalStateException: Web app root system property already set to different value: 'webap
2015-12-07 17:07
483 查看
严重: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\redmanor_b2c_back\] instead of [D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\redmanor_b2c_front\]
- Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:144)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
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$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
java.lang.IllegalStateException: Web app root system property already set to different value: 'Portal.root' = [C:\jakarta-tomcat-5.0.30\webapps\Portal\] instead of [C:\jakarta-tomcat-5.0.30\webapps\Poral\] - Choose unique values for the 'webAppRootKey' context-param
in your web.xml files!
解决方法 一:
检查发布的多个Web应用的web.xml文件,其中是否定义了相同的webAppRootKey, 如:
### app1:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app1.root</param-value> <!-- 第一个应用的根 -->
</context-param>
### app2:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app1.root</param-value> <!-- 第二个应用的根 -->
</context-param>
解决方案二:
webAppRootKey是在java web项目的web.xml配置文件中表示项目的唯一标示,在Eclipse调试Web项目时,项目的路径是一个临时路径,不在真正的路径下,可以通过log4j日志的方式打印出属性值,来看看临时项目路径在哪里,可以用System.getProperty("web.sample.root");如果web.xm 内没有设置webAppRootKey项,是为默认设置,那么webAppRootKey就是缺省的"webapp.root"。
解决办法: 两个web应用中定义了相同的webAppRootKey或者都没有定义,则现在就需要为每个web都定义一个webAppRootKey。
### app1:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app1.root</param-value>
</context-param>
### app2:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app2.root</param-value>
</context-param>
严重: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\redmanor_b2c_back\] instead of [D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\redmanor_b2c_front\]
- Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:144)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
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$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
解决多重web应用中webapp. root重用的问题
当在tomcate中发布多个同根的应用时,容易出现这样异常:java.lang.IllegalStateException: Web app root system property already set to different value: 'Portal.root' = [C:\jakarta-tomcat-5.0.30\webapps\Portal\] instead of [C:\jakarta-tomcat-5.0.30\webapps\Poral\] - Choose unique values for the 'webAppRootKey' context-param
in your web.xml files!
解决方法 一:
检查发布的多个Web应用的web.xml文件,其中是否定义了相同的webAppRootKey, 如:
### app1:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app1.root</param-value> <!-- 第一个应用的根 -->
</context-param>
### app2:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app1.root</param-value> <!-- 第二个应用的根 -->
</context-param>
解决方案二:
webAppRootKey是在java web项目的web.xml配置文件中表示项目的唯一标示,在Eclipse调试Web项目时,项目的路径是一个临时路径,不在真正的路径下,可以通过log4j日志的方式打印出属性值,来看看临时项目路径在哪里,可以用System.getProperty("web.sample.root");如果web.xm 内没有设置webAppRootKey项,是为默认设置,那么webAppRootKey就是缺省的"webapp.root"。
解决办法: 两个web应用中定义了相同的webAppRootKey或者都没有定义,则现在就需要为每个web都定义一个webAppRootKey。
### app1:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app1.root</param-value>
</context-param>
### app2:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>app2.root</param-value>
</context-param>
相关文章推荐
- 玩转android自定义控件二——自定义索引栏listview
- android SQLiteOpenHelper使用示例
- Android开发之TabHost应用详解
- Android开发中适配多种 ROM 的快捷方式是如何实现的?
- 详细讲述iOS自定义转场
- iOS开发 3D-touch使用
- Android -wifi 直连(wifi direct )
- HybridApp解决方案_No1_混合模式(Hybrid)App开发概述
- java Android 算一定业务规定的工作日(除去法定节假日、调休周末上班日)代码copy直接用
- 如何设计一个 iOS 控件?(iOS 控件完全解析)
- iOS App开发文档--请求加解密方案概述
- android(38)(加载大图到内存)
- Ios和tvos按需请求资源简介
- AndroidStudio中使用DDMS工具
- android 百度地图 在线建议查询
- Unity3D 关于资源加载(Resources和AssetBundle)和内存管理
- Android蓝牙4.0读写数据返回状态码及出现异常解决办法
- Android中的MVP模式使用
- ios开发之升级Xcode后插件失效解决方法
- [CSS3 Practice] Learn Apple Navigator Bar