java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:143)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:116)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
Truncated. see log file for complete stacktrace
关于weblogic下发布war包部署出现上述错误问题,网上有两种方式解决此问题,第一种是创建weblogic.xml在web-inf下然后加入配置如下:
<?xml version="1.0" encoding="UTF-8"?>  

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"

"http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">

<weblogic-web-app>

<container-descriptor>

<show-archived-real-path-enabled>true</show-archived-real-path-enabled>

</container-descriptor>

</weblogic-web-app>

但是加入此配置此文件提示找不到xxxxxxx,具体你自己看吧


还有种方式是在web.xml中加入如下配置

<context-param>  
<param-name>log4jExposeWebAppRoot</param-name>
<param-value>false</param-value>
</context-param>

解释:

log4jExposeWebAppRoot:应用是否可以通过System.getProperties(“webAppRootKey”)得到当前应用名。

weblogic版本:11g