Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log4JLogger Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log4JLogger

    Deploying a plugin containing a jsf webapp within spring dm, I receive the error message below. The target platform contains com.springsource.org.apache.commons.logging-1.1.1.jar and the jsf webapp commons-logging.jar in the WEB-INF/lib/ directory, which is referenced within the MANIFEST.MF in the section Bundle-ClassPath: ... WEB-INF/lib/commons-logging.jar, ...

    Shortly before the java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log4JLogger, several java.lang.ClassNotFoundException: javax.servlet.LocalStrings_de_DE are thrown.

    Invoking the application at localhost yields a HTTP Status 404 - /jsfsample/testjsf.faces, description The requested resource (/jsfsample/testjsf.faces) is not available.


    How can I solve this issue?

    Code:
    BundleClassLoader[org.springframework.bundle.osgi.core_1.1.0].getResource(META-INF/services/org.apache.commons.logging.LogFactory)
    BundleClassLoader[org.springframework.bundle.osgi.core_1.1.0].getResource(META-INF/services/org.apache.commons.logging.LogFactory) failed.
    BundleClassLoader[com.springsource.org.apache.commons.logging_1.1.1].loadClass(org.apache.commons.logging.impl.LogFactoryImpl)
    BundleLoader[com.springsource.org.apache.commons.logging_1.1.1].loadBundleClass(org.apache.commons.logging.impl.LogFactoryImpl)
    BundleLoader[com.springsource.org.apache.commons.logging_1.1.1].findLocalClass(org.apache.commons.logging.impl.LogFactoryImpl)
    BundleLoader[com.springsource.org.apache.commons.logging_1.1.1] found local class org.apache.commons.logging.impl.LogFactoryImpl
    BundleClassLoader[org.springframework.bundle.osgi.core_1.1.0].loadClass(org.apache.commons.logging.impl.Log4JLogger)
    BundleLoader[org.springframework.bundle.osgi.core_1.1.0].loadBundleClass(org.apache.commons.logging.impl.Log4JLogger)
    BundleLoader[org.springframework.bundle.osgi.core_1.1.0].findLocalClass(org.apache.commons.logging.impl.Log4JLogger)
    BundleClassLoader[org.springframework.bundle.osgi.core_1.1.0].findClass(org.apache.commons.logging.impl.Log4JLogger)
    BundleClassLoader[org.springframework.bundle.osgi.core_1.1.0].loadClass(org.apache.commons.logging.impl.Log4JLogger) failed.
    java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log4JLogger
    	at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
    	at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1081)
    	at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)
    	at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)
    	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)
    	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)
    	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
    	at org.springframework.osgi.util.LogUtils.createLogger(LogUtils.java:52)
    	at org.springframework.osgi.util.BundleDelegatingClassLoader.<clinit>(BundleDelegatingClassLoader.java:46)
    	at org.springframework.osgi.extender.internal.support.NamespacePlugins$Plugin.<init>(NamespacePlugins.java:73)
    	at org.springframework.osgi.extender.internal.support.NamespacePlugins$Plugin.<init>(NamespacePlugins.java:61)
    	at org.springframework.osgi.extender.internal.support.NamespacePlugins.addHandler(NamespacePlugins.java:106)
    	at org.springframework.osgi.extender.internal.support.NamespaceManager.addHandler(NamespaceManager.java:151)
    	at org.springframework.osgi.extender.internal.support.NamespaceManager.maybeAddNamespaceHandlerFor(NamespaceManager.java:107)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.maybeAddNamespaceHandlerFor(ContextLoaderListener.java:646)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.start(ContextLoaderListener.java:380)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:991)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:985)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:966)
    	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:317)
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:329)
    	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1046)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:573)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:495)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:275)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:455)
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:189)
    	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:291)
    Last edited by rtrauni; Mar 30th, 2009, 05:48 AM.

  • #2
    1. please use [ c o d e ] tags to make the post readable.
    2. don't use commons logging - (http://is.gd/pBQq)
    3. use a commons logging alternative such as slf4j (http://is.gd/pBRP)

    Comment


    • #3
      Similar issue while running via STS IDE

      I have a similar problem... except it happens only when I try to run the Spring Web MVC app via the STS IDE (version 2.3.2). I start off by creating a dynamic web application project, add Spring project nature. The app just involves redirecting to a HelloWorld controller that redirects to a simplistic view page. Regardless of whether commons-logging 1.1.1 is added or not to the build path, running the app in the IDE yields the excetion:

      Code:
      SEVERE: Servlet /NewIssues threw load() exception
      java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
      	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
      	at org.springframework.web.servlet.DispatcherServlet.<clinit>(DispatcherServlet.java:208)
      However, if I package as a WAR and deploy it to a running instance of tcServer or even Tomcat, the app works just fine. I don't know how to resolve this! I need a push in the right direction.

      Thanks.

      webuser

      Comment


      • #4
        I am having this problem too. Anyone have any ideas?

        I am using the last Eclipse (Indigo). My project builds fine, but when I start tomcat (in Eclipse), I get the following error:

        Code:
        SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
        java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
        	at org.springframework.web.context.ContextLoader.<clinit>(ContextLoader.java:146)
        	at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
        	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
        	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
        Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
        	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
        	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
        	... 18 more
        I have "commons-logging.jar" in my project class path, which is a part of the Apache JSF Library). So I can't for the life of me see why this error is occuring when I start tomcat.

        Can any help me?

        Thanks,
        Glen

        Comment

        Working...
        X