Log4J配置错误 - 关于webapp.root的设置

在部署多个项目时遇到Log4J的webapp.root配置冲突异常,导致启动失败。异常信息表明不同项目的webapp.root设置不一致。通过检查web.xml并未发现webAppRootKey配置,经研究发现若未配置则使用默认值‘webapp.root’。为解决此问题,需要在每个项目的web.xml中明确设置唯一的webAppRootKey,例如设置为‘petclinic.root’,以避免系统属性冲突。
摘要由CSDN通过智能技术生成

  近日,因为懒惰,直接从原有项目切出一个分块成了一个项目,然后同时发布启动,出现以下异常

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:/tomcat-5.0.19/webapps/tzbms/] instead of [D:/tomcat-5.0.19/webapps/its/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!

at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:99)
    at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:116)
    at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:51)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3773)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4270)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:320)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:657)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:476)
    at org.apache.catalina.startup.Ho

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值