This topic has been locked.
Pinned topic Expose OSGi service via JAX-RS in Liberty
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Is it possible to expose OSGi services via JAX-RS using the Liberty profile? I'd like to use OSGi as the componentization model for my application and be able to provide REST interfaces to it. Any pointers would be appreciated.
Re: Expose OSGi service via JAX-RS in Liberty2012-10-16T14:17:24ZThis is the accepted answer. This is the accepted answer.Hi Sumant,
You can actually create JAX-RX services inside OSGi bundles, and those services can be accesses when deploying to the Liberty profile.
However, you cannot expose OSGi services as JAX-RX services. To do this you'll need SCA, which is not supported on the Liberty profile today.
Hope this helps.
Re: Expose OSGi service via JAX-RS in Liberty2012-10-16T16:40:49ZThis is the accepted answer. This is the accepted answer.
Re: Expose OSGi service via JAX-RS in Liberty2012-10-16T17:47:26ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Start by creating an OSGi bundle:
- On the first page of the wizard, set the target runtime of the bundle to the Liberty Profile.
- Then in the configuration section, select the Custom checkbox and click on the Advanced button. This opens the project facets page.
- In that page, select Dynamic Web Module and JAX-RS (REST Web Services) checkboxes. Click OK.
- Then click Finish in the wizard.
- Open the project's manifest file, in the Dependencies tab, import the com.ibm.websphere.jaxrs.server package.
That should get you started with the proper project configuration and you should be able create JAX-RS service in it as you normally would.