0

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.

rogermushroom
  • 5,486
  • 4
  • 42
  • 68
  • Just to be clear, are you trying to run osgi container within glassfish or you're trying to run glassfish within osgi container? – Wins Oct 24 '12 at 18:28
  • @wins For the current Web app I am running glassfish 3.1 which I understood runs in an OSGi container and I am trying to convert jars from the current web app to run as bundles with Glassfish by deploying to Felix (copying the jars to autocomplete). I haven't installed anything in Glassfish. – rogermushroom Oct 24 '12 at 18:32
  • In that case, 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 – Wins Oct 24 '12 at 18:37

1 Answers1

1

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

Wins
  • 3,420
  • 4
  • 36
  • 70
  • All I want to do is run spring in Glassfish using OSGi in as simpler way as possible. I thought gemini blueprint offered "bindings" to allow spring to work like this which is why I was deploying it to Glassfish. What should my approach be? – rogermushroom Oct 24 '12 at 18:35
  • Please see my comment in the question area. I miss understand your question when writing this answer. I'll remove this answer – Wins Oct 24 '12 at 18:38
  • Just update the answer you provided with the comments you made in the question area – rogermushroom Oct 24 '12 at 18:40
  • I thought at first it strange that gemini is delivered without the basic dependencies but when I think about it so it spring and a lot of other packages. – rogermushroom Oct 25 '12 at 13:36