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
Spring DM - Logging Configuration Problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring DM - Logging Configuration Problem

    Hi,

    i try to migrate an existing spring application to osgi and spring dm.

    When i start the application i get the stack-trace, listed below.
    It seems that the osgi.extender can not create the applicationi context due to an error in the
    logging configuration. I added the slf4j (version 1.5.11) plugins "org.slf4j.log4j", "org.slf4j.jcl" and "org.slf4j.api",
    to use slf4j on top of log4j.
    The log4j properties file is bundled in a fragment, that is assigned to the log4j plugin.

    Obviously the osgi.extender tries to run the apache commons logger instead of slf4j.

    What have i missed.

    - is it necessary to start the logging bundles explicitly (via the config.ini) before the osgi.extender is startet?
    - where do i place the log4j.properties file to make it accessible for the osgi.extender?
    - is there any further configuration necessary, to get the log-system running?

    Any help would be much appreciated.

    Thanks


    Code:
    osgi> 17:53:36.178 [Start Level Event Dispatcher] INFO  o.s.o.e.i.a.ContextLoaderListener - Starting [org.springframework.osgi.extender] bundle v.[1.1.0]
    17:53:36.189 [Start Level Event Dispatcher] DEBUG o.s.o.e.i.a.ContextLoaderListener - Spring-DM v.[1.1.0] is wired to Spring core bundle org.springframework.core version [2.5.6]
    !SESSION 2011-05-09 17:53:29.956 -----------------------------------------------
    eclipse.buildId=unknown
    java.version=1.6.0_24
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
    Command-line arguments:  -dev file:/home/Entwicklung/eclipse_workspaces/test/.metadata/.plugins/org.eclipse.pde.core/Workbench/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -console -consolelog
    
    !ENTRY org.springframework.osgi.extender 4 0 2011-05-09 17:53:36.205
    !MESSAGE 
    !STACK 0
    org.osgi.framework.BundleException: Exception in org.springframework.osgi.extender.internal.activator.ContextLoaderListener.start() of bundle org.springframework.osgi.extender.
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
    	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
    	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
    	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
    	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    	at org.springframework.osgi.io.internal.resolver.PackageAdminResolver.<clinit>(PackageAdminResolver.java:52)
    	at org.springframework.osgi.extender.internal.activator.SpringTypeCompatibilityChecker.<init>(SpringTypeCompatibilityChecker.java:49)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.start(ContextLoaderListener.java:365)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
    	... 11 more
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    	... 17 more
    Root exception:
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    	at org.springframework.osgi.io.internal.resolver.PackageAdminResolver.<clinit>(PackageAdminResolver.java:52)
    	at org.springframework.osgi.extender.internal.activator.SpringTypeCompatibilityChecker.<init>(SpringTypeCompatibilityChecker.java:49)
    	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.start(ContextLoaderListener.java:365)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
    	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
    	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
    	at org.eclipse.osgi.framework.internal.core".AbstractBundle.resume(AbstractBundle.java:374)
    	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
    	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    	... 17 more
    17:53:36.218 [Start Level Event Dispatcher] INFO  d.i.backend.internal.Activator - TEST => starting backend
    
    !ENTRY org.eclipse.osgi 4 0 2011-05-09 17:53:36.223
    !MESSAGE Bundle org.springframework.osgi.extender_1.1.0 [194] is not active.
    Last edited by Christian A; May 9th, 2011, 01:48 PM.

  • #2
    Show the list of deployed bundles.

    Comment


    • #3
      Thanks for your reply.

      Replacing the bundle dependency to slf4j by package imports solved the problem.

      Comment

      Working...
      X