Virgo 3.6.1 + Spring 3.2.2 + org.springframework.osgi.core [message #1053702] |
Tue, 07 May 2013 10:09 |
Maarten Winkels Messages: 11 Registered: May 2013 |
Junior Member |
|
|
Hi All,
I'm new to using Virgo and my main goal is to transform a standard Web application running on Tomcat to run on Virgo (OSGi) to use shared lib and shared service features.
The Web application I'm deploying is using Spring 3.2.2 with Java @Configuration.
When I deployed the app on Virgo 3.6.1 it had problems loading the @Configuration classes: The CLib classes could not be found on the classpath. After googling the internet I found that I would have to upgrade the Spring bundles in the Virgo user region to 3.2.2 to make this work. I follow this FAQ to upgrade to 3.2.2, but ran into problems com.springsource.org.aspectj.weaver-1.7.1.RELEASE.jar (as described in the FAQ): Virgo would no longer start and it would show this message in the log
!ENTRY org.eclipse.virgo.medic 4 0 2013-05-07 03:24:10.573
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.eclipse.virgo.medic_3.6.1.RELEASE [37]" could not be resolved. Reason: Missing Constraint: Import-Package: org.aspectj.lang; version="[1.6.12,2.0.0)"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
...and then a whole lot more missing constraints.
I had already changed the configuration files as specified in the FAQ. I also tried upgrading to com.springsource.org.aspectj.weaver-1.7.2.RELEASE.jar, but to no avail.
After downgrading to com.springsource.org.aspectj.weaver-1.6.12.RELEASE.jar everything seemed to work ok: I could deploy a bundle depending spring 3.2.2 and exporting a service. YEAH!
Now I tried to use the service in a WAR. I added
Import-Bundle: org.springframework.osgi.core
to the manifest, but then I got the following error:
nstallation of bundle '...' failed. org.eclipse.virgo.nano.deployer.api.core.DeploymentException: Unable to satisfy dependencies of bundle '...' at version '...': Import-Bundle with symbolic name 'org.springframework.osgi.core' in version range '[0.0.0, oo)' could not be satisfied
and indeed if I run the packages org.springframework.osgi.core on osgi console it turns up empty.
Now I've installed bundle spring-osgi-core 1.2.1 from EBR (and spring-osgi-io 1.2.1 for good measure) in the user region, but now I run into the following error:
Unexpected exception parsing XML document from class path resource [...-context.xml]; nested exception is org.springframework.beans.FatalBeanException: Class [org.springframework.osgi.config.OsgiNamespaceHandler] for namespace .../schema/osgi] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
It is trying to parse a spring context which imports the osgi service using <osgi:reference .../> but apparently cannot find the correct classes for the namespace handler.
At this point I'm not sure what to do. The only option I see is to update the spring framework in the kernel space as well, but I'm not sure what problems I will run into next...
Any pointers as to how to use spring 3.2.2 with osgi reference injection on virgo (3.6.1)?
Thanks!
Cheers,
-Maarten Winkels
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03133 seconds