Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » virgo + springDM + custom Application Context Listener
virgo + springDM + custom Application Context Listener [message #813421] Mon, 05 March 2012 08:43 Go to next message
eugene rabii is currently offline eugene rabiiFriend
Messages: 13
Registered: February 2012
Junior Member
Suppose I want to register a custom application context listener. SpringDM books says I must do something like this:

<beans:bean id="osgiApplicationContextListener" class="org.springframework.osgi.extender.internal.activator.ListListenerAdapter">
<beans:constructor-arg>
<beans:list>
<beans:bean class="org.springframework.osgi.extender.internal.support.DefaultOsgiBundleApplicationContextListener"/>
<beans:bean id="myTest" class="com.eugene.ApplicationContextListener"/>
</beans:list>
</beans:constructor-arg>
</beans:bean>

This is created in META-INF/spring/app-config.xml

Create, deploy the bundle, then I get this Exception:


at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.doStart(StandardBundleInstallArtifact.java:271)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.driveDoStart(AbstractInstallArtifact.java:209)
at org.eclipse.virgo.kernel.install.artifact.internal.bundle.StandardBundleInstallArtifact.start(StandardBundleInstallArtifact.java:260)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.start(PipelinedApplicationDeployer.java:301)
... 7 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.springframework.osgi.extender.internal.activator.ListListenerAdapter in KernelBundleClassLoader: [bundle=com.eugene.sample-service.osgi-runner_1.0.0.SNAPSHOT]
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:138)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
... 66 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.osgi.extender.internal.activator.ListListenerAdapter
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:134)
... 71 common frames omitted

Is there a setting that i am missing about or why can't it find the class. Bundle :

30|Active | 1|spring-osgi-extender (1.2.1)

is active.

Sounds to me this is a bug, but may be I am missing something.

Thank You,
Eugene.

[Updated on: Mon, 05 March 2012 08:45]

Report message to a moderator

Re: virgo + springDM + custom Application Context Listener [message #813435 is a reply to message #813421] Mon, 05 March 2012 09:04 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Please see the Virgo FAQ for how to diagnose class loading errors. I notice that the package containing the class appears to be internal, so perhaps it is not exported?
Previous Topic:Class not found, export only problem
Next Topic:Is Virgo Tooling snapshot compatible with VTS 3.0.*?
Goto Forum:
  


Current Time: Fri Dec 19 12:00:46 GMT 2014

Powered by FUDForum. Page generated in 0.02263 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software