tomcat6中部署了兩個web應用,都采用的是SSH框架,記錄日志都用了log4j,結果webroot.app被重用了,啟動tomcat時,出現錯誤,部分錯誤信息如下:ERROR:org.springframework.web.util.Log4jConfigListener java.lang.IllegalStateException: Web app
root system property already set to different value: 'webapp.root' = [D:\Program
Files\tomcat6\webapps\esis\] instead of [D:\Program Files\tomcat6\webapps\esisOne\] - Choose
unique values for the 'webAppRootKey' context-param in your web.xml files!
解決辦法: 兩個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>
重新啟用服務,然后進而測試!