Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Logging error in OSGI/Spring DM(Unable to get log-system running)
Logging error in OSGI/Spring DM [message #669298] Mon, 09 May 2011 15:47 Go to next message
Christian A is currently offline Christian A
Messages: 13
Registered: March 2011
Junior Member
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


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.

[Updated on: Mon, 09 May 2011 15:49]

Report message to a moderator

Re: Logging error in OSGI/Spring DM [message #669761 is a reply to message #669298] Wed, 11 May 2011 08:19 Go to previous message
Martin Lippert is currently offline Martin Lippert
Messages: 123
Registered: July 2009
Senior Member
Hi Christian!

I would recommend asking this question in the Virgo group. They are
better experts in Spring DM, I guess... :-)

Cheers,
-Martin


On 09.05.11 21:47, Christian A wrote:
> 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?
>
> Thanks
>
>
> 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/.pl ugins/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.Context LoaderListener.start()
> of bundle org.springframework.osgi.extender.
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:806)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:755)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:370)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:374)
> at
> org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1067)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:561)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:546)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.i ncFWSL(StartLevelManager.java:459)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.d oSetStartLevel(StartLevelManager.java:243)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.d ispatchEvent(StartLevelManager.java:440)
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(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.PackageAdminRe solver. <clinit>(PackageAdminResolver.java:52)
> at
> org.springframework.osgi.extender.internal.activator.SpringT ypeCompatibilityChecker. <init>(SpringTypeCompatibilityChecker.java:49)
> at
> org.springframework.osgi.extender.internal.activator.Context LoaderListener.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.s tartActivator(BundleContextImpl.java:774)
> ... 11 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.commons.logging.LogFactory
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:506)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:422)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(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.PackageAdminRe solver. <clinit>(PackageAdminResolver.java:52)
> at
> org.springframework.osgi.extender.internal.activator.SpringT ypeCompatibilityChecker. <init>(SpringTypeCompatibilityChecker.java:49)
> at
> org.springframework.osgi.extender.internal.activator.Context LoaderListener.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.s tartActivator(BundleContextImpl.java:774)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:755)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:370)
> at
> org.eclipse.osgi.framework.internal.core".AbstractBundle.resume(AbstractBundle.java:374)
> at
> org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1067)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:561)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:546)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.i ncFWSL(StartLevelManager.java:459)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.d oSetStartLevel(StartLevelManager.java:243)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.d ispatchEvent(StartLevelManager.java:440)
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(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.findClassInter nal(BundleLoader.java:506)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:422)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(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.
Previous Topic:creating and updateable product
Next Topic:ConfigAdmin getConfiguration from external storage???
Goto Forum:
  


Current Time: Sat Aug 23 11:37:37 EDT 2014

Powered by FUDForum. Page generated in 0.01700 seconds