users@jersey.java.net

[Jersey] Jersey 2.7 with Karaf

From: Pascal Klink <pascal.klink_at_web.de>
Date: Wed, 26 Mar 2014 16:55:37 +0100
Hi everyone!
 
Im currently trying to create an OSGI based Web Application which is designed to work the following way:
 
There exists a Database which can be accessed through an OSGI service (which is a DataSource). There exists a WebServer (Grizzly) which waits for HttpHandlers to be published as OSGI Services and then registers them. Finally there can exist multiple HttpHandler Services which will perform actions on the database or server static content.
 
The problems which are slowly exasperating me are the OSGI dependencies of the Jersey modules (server, client, common, container-grizzly2-http). When creating the bundle, those jars create a huge amount of dependencies from which some cannot be resolved at startup.
 
So the question is: Can anybody tell me how to properly create bundles of those jersey modules which export their jersey packages and can be deployed in an osgi container (I'm using karaf) without relying on any other packages? Because then I could just import the corressponding packages in my bundles and would not have to deal with the dependencies of the modules. I'm using the maven-bundle-plugin in order to create the bundles.
 
Thanks in advance for your help,
Pascal