Topic
1 reply Latest Post - ‏2012-12-13T11:26:08Z by SystemAdmin
SystemAdmin
SystemAdmin
590 Posts
ACCEPTED ANSWER

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.

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>file:${configuration.home}/environment.properties</param-value>
</context-param>

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
    SystemAdmin
    590 Posts
    ACCEPTED ANSWER

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

    ‏2012-12-13T11:26:08Z  in response to SystemAdmin
    Hi,

    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>
    


    Thanks
    Alasdair