I am working on one of the project. We are deploying that project in weblogic 12.1.3. In that project, client want log4j.properties file outside from the EAR/WAR file. I try to configure as below in web.xml:-
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>
file://C:/externalProperties/ODCMsgProcessing/log4j/log4j.properties
</param-value>
</context-param>
But It is giving me exception when I am trying to deploy it on weblogic as:-
<Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.util.Log4jConfigListener failed: java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded.
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:155)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:119)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:49)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:678)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
Truncated. see log file for complete stacktrace
>
If I deploy project in folder format, than, it is deploying successfully. But I want to deploy it in WAR or EAR format only. So can anybody suggest me any alternate solution where I can configure log4j.properties file outside EAR/WAR.