Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo 3.6.1 + Spring 3.2.2 + org.springframework.osgi.core
Virgo 3.6.1 + Spring 3.2.2 + org.springframework.osgi.core [message #1053702] Tue, 07 May 2013 10:09 Go to next message
Maarten Winkels is currently offline 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
Re: Virgo 3.6.1 + Spring 3.2.2 + org.springframework.osgi.core [message #1053797 is a reply to message #1053702] Tue, 07 May 2013 15:46 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
I upgraded Virgo Server for Apache Tomcat 3.6.1 to Spring framework 3.2.2 and AspectJ 1.7.1 by following the FAQ precisely and it started first time.
Re: Virgo 3.6.1 + Spring 3.2.2 + org.springframework.osgi.core [message #1058738 is a reply to message #1053797] Tue, 14 May 2013 19:27 Go to previous messageGo to next message
Maarten Winkels is currently offline Maarten Winkels
Messages: 11
Registered: May 2013
Junior Member
Hi Glyn,

It started working somehow. I'm not sure how. Maybe it didn't work because I deleted the AspectJ 1.6.12.RELEASE version. I assumed it was obsolete and would be replaced with the new version, but maybe something was depending on it.

Thanks,
-Maarten Winkels
Re: Virgo 3.6.1 + Spring 3.2.2 + org.springframework.osgi.core [message #1058811 is a reply to message #1058738] Wed, 15 May 2013 08:33 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Don't you just hate it when that happens and you lose the opportunity to understand the problem fully? Wink
Re: Virgo 3.6.1 + Spring 3.2.2 + org.springframework.osgi.core [message #1336187 is a reply to message #1053702] Tue, 06 May 2014 09:19 Go to previous message
Ferdinand Mising name is currently offline Ferdinand Mising name
Messages: 3
Registered: April 2011
Junior Member
For more solving...

I had this problem before and solved by removing returns from the java6-server.profile.
Previous Topic:Subdomain and virtual host configuration on Virgo
Next Topic:Ready, Steady, Vir...Go!
Goto Forum:
  


Current Time: Thu Oct 23 22:10:57 GMT 2014

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

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