I have a Java Web Application using Spring and running in Glassfish 3.1.2 and I am trying to convert it to an OSGi architecture.
I started by downloading Gemini blueprint and copying the jars to the autodeploy/bundle
directory in Glassfish at which point I received a lot of errors regarding missing requirements, like this:
[#|2012-10-24T12:58:07.176 0500|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_Thread
ID=18;_ThreadName=Thread-5;|org.osgi.framework.BundleException:
Unresolved constraint in bundle org.eclipse.gemini.blueprint.core [258]:
Unable to resolve 258.1: missing requirement [258.1] osgi.wiring.package; (&(osgi.wiring.package=org.aopalliance.aop)(version>=0.0.0))
And similar erros for org.apache.commons.logging
amongst others.
I have been reading quite a lot about OSGi and Glassfish but I am unable to find any examples of creating OSGi spring applications for Glassfish so I guess perhaps I am doing something very wrong.
Anyone have any ideas whether what I am doing is correct and if so how to resolve these issues.
It seems you're trying to run osgi container within glassfish. If so, you have to use or write a kind of osgi bootstrapper that will start up the osgi container. It should boot up the osgi container using the necessary bundles that is the minimum set for osgi container to be ready for the next bundle to deploy.
Updated answer: Based on the error message, it seems your Gemini bundle requires bundle(s) which is not available within the container just yet. You need to figure out what are the packages/classes it import from other bundles and install and start them before deploying Gemini. You can do it by examining the manifest of Gemini bundle