0

I am new to OSGi and I am attempting to investigate OSGi JAX-RS bundles

My target runtime is IBM Liberty (wlp-beta-osgi-2016.1.0.0)

I would like my JAX-RS bundle to be started/loaded automatically and had the thought this can be achieved using decalaritve Services.

I do not want to have to develop activators for each of my JAX-RS services, as the example code I have found for this seems overly complicated and i have almost 100 individual JAX-RS services required.

I am using eclispe with WDT (wdt-update-site_8.5.5.8.v20151130_1844) which supports OSGi bundles and allows me to create a blueprint file for each bundle

My issue is I cannot discover away to have my JAXRS bundle to start i can get pure java bundles to execute however my JAXRS bundles never become active and i cannot seem to find any logs to triuble shoot the issue.

Is what I am attempting to achieve not possible?

Hector
  • 4,016
  • 21
  • 112
  • 211
  • Can you clarify what is going wrong exactly? You said that the JAXRS bundles never become active... how do you know? Are you starting them? What behaviour do you expect to see and how does the actual behaviour differ? – Neil Bartlett Jan 27 '16 at 11:57

1 Answers1

1

How are you deploying the JAR-RS bundles to Liberty? To deploy to Liberty, you should create an OSGi Application (EBA). Any bundles that are installed as part of an OSGi Application should be automatically started.

Graham
  • 86
  • 4
  • thats exactly what i did, i have liberty servers inside eclispe and create an Application Bundle and deploy it to liberty fine, it all works .. i then add a JAX-RS bundle and add it into the Application bundle, redploy and none of the bundles start then, there are no logs that i can find – Hector Jan 27 '16 at 13:12
  • But did you start the bundles or not?? – Neil Bartlett Jan 27 '16 at 17:20
  • Sorry, only just rediscovered this thread. Suspect I'm too late, but will comment anyway. If you're using the beta, you can use the osgiAppConsole-1.0 feature to view the application bundles, their states and wiring. https://developer.ibm.com/wasdev/docs/osgi-application-console-feature/ You could also try to manually start it to see if that produces an error. Do you have the jaxrs-1.1 or jaxrs-2.0 features installed and configure into your server? – Graham May 05 '16 at 11:23
  • In addition to the above, you can also turn on equinox resolver tracing as follows: Create a file called osgi_debug.options in your server directory and add the entry org.eclipse.osgi/resolver/report=true . Create a bootstrap.properties file in your server directory and add osgi.debug=./osgi_debug.options . Restart your server. You should see resolver messages in the console and messages.log files. – Graham May 05 '16 at 11:27