IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
  • 1 reply
  • Latest Post - ‏2012-12-13T11:26:08Z by SystemAdmin
590 Posts

Pinned topic Not able to load logging properties when deployed as bundled war at Liberty

‏2012-12-13T11:07:10Z |
We are providing logging properties from external file, and this file as configured at web.xml for log4jConfigLocation.


When I deployed bundled war its giving error.
ERROR SRVE0283E: Exception caught while initializing context: 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:137)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1991)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:753)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:5779)
at com.ibm.ws.webcontainer.osgi.webapp.WebGroup.addWebApplication(WebGroup.java:84)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.addWebApplication(DynamicVirtualHost.java:156)

But when deployed war as expanded folder and its successfully deployed and logging configured as expected.

Help us, how to deploy bundled war with proper logging configuration.

We are using Liberty profile and spring 3.0.5
Thanks in advance.
  • SystemAdmin
    590 Posts

    Re: Not able to load logging properties when deployed as bundled war at Liberty


    The error message you are seeing is occurring because the Spring Framework requires the web application to be deployed as a directory rather than as a .war file. The Liberty profile does not convert .war file deployed applications into exploded applications at runtime, this needs to be done prior to deploying the application to the runtime. This can be simply done using unzip tools. Using the unix command line tool you could type
    unzip -d <path to server dir>/apps/mywebapp.war <path to .war file>