• Entries (RSS)
  • Comments (RSS)

org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log

Posted by | Posted in JBoss Developer Studio | Posted on 05-01-2009

Tagged Under : , , ,

I was helping my team to migrate an application that was running on WebSphere Application Server to JBoss. The web application was using struts as the framework. The application did not show any error message in the IDE. The IDE we were using was JBoss Developer Studio. However at the time of deployment we get an error message like this

INFO  [ContainerBase] Marking servlet action as unavailable
ERROR [ContainerBase] Servlet /XXXWeb threw load() exception
	org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log

This makes our struts framework unavailable to the application.

After doing some research work we found a solution to this problem. Remove bundled commons-logging.jar from web application. I.e., remove commons-logging.jar from WEB-INF\lib folder of your web application.

I am not sure about the reason for this behavior. Seems like a bug to me. May be a bug in JBoss, Eclipse or JBoss Developer studio.

java.net.MalformedURLException: SRVE0238E: Resource paths should have a leading slash

Posted by | Posted in RAD | Posted on 22-09-2008

Tagged Under : ,

Yesterday was my first day on Struts. We were adding some new features to an existing application. The application was running in WAS 5.1 using Struts 1.1. Since I like RAD more than WSAD, I thought of using RAD for my development. I asked my team to export the project from WSAD and I imported the project in my RAD workspace. There were no issues till this point. Everything looked perfectly fine and I started the server. The server also started without any issues. However my Struts 1.1 project did not start. It was trying to start and failed with an error message.

0000000a ActionServlet E org.apache.struts.action.ActionServlet handleConfigException Parsing error processing resource path 
                                 java.net.MalformedURLException: SRVE0238E: Resource paths should have a leading slash
	at com.ibm.ws.webcontainer.webapp.WebApp.getResource(WebApp.java:1956)
	at com.ibm.ws.webcontainer.facade.ServletContextFacade.getResource(ServletContextFacade.java:100)
	at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1002)
	at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
	at javax.servlet.GenericServlet.init(GenericServlet.java:256)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:274)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1398)
	at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:86)
	at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:763)
	at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:506)
	at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:395)
	at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:115)
	at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:128)
	at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:905)
	at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:858)
	at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:167)
	at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:391)

That was my first error with Struts. Anyway I managed to resolve this issue with very little search. There are two ways to resolve this issue. By making a small change in the web.xml file. ie, Open your web.xml file and search for WEB-INF/struts-config.xml and change this entry to /WEB-INF/struts-config.xml. Yes just a slash in front of the WEB-INF.

The second is to tell the WebSphere server to add this slash for you. For that logon to you admin console and click on Servers > server1 > WebContainer > Custom Properties > New property. Enter prependSlashToResource as the name of the property and true as the value of the property.