users@jersey.java.net

Re: [Jersey] Jersey as pure OSGi bundles

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 18 Jun 2009 14:56:47 +0200

On Jun 18, 2009, at 5:54 AM, Richard Wallace wrote:

>
> On Wed, Jun 17, 2009 at 8:59 AM, Richard Wallace <rwallace1979_at_gmail.com
> > wrote:
> On Wed, Jun 17, 2009 at 3:28 AM, Paul Sandoz <Paul.Sandoz_at_sun.com>
> wrote:
> >
> > Hi Richard,
> >
> > Thanks very much for persisting with this.
> >
> >
> > On Jun 15, 2009, at 2:05 AM, Richard Wallace wrote:
> >
> >> Hey all,
> >>
> >> I've done some work on making the Jersey modules real OSGi bundles.
> >> I've been doing this work on a branch I created on GitHub
> >> <http://github.com/rwallace/jersey-osgi-ified/tree/master>. I now
> >> have the jersey-core, jersey-server and jersey-json loading and
> >> working in an OSGi framework (tested on Felix 1.8.0), without
> having
> >> to do any hacks or classloading tricks in application code. Just
> >> create the ServletContainer and go!
> >>
> >
> > Great!
> >
> > Do you have a simple maven example of how you are deploying? that
> way i can easily do a full debug cycle :-)
> >
>
> I don't currently. But it should be pretty easy to put one together.
> I can work on that a bit this evening.
>
> Here's a simple example of how you would do the OSGi tests <http://github.com/rwallace/jersey-osgi-ified/tree/4a142095e7dcd2dd5cd401c4ddae64c2a3518951/jersey/osgi-tests
> > It doesn't work yet because it needs a fixed jsr311-api 1.1 jar
> to be loaded into the OSGi framework. But once we have that, we can
> add it the dependencies and should be on our way.
>

Thanks!

There is a lot going on behind the scenes here but i am guessing that
the PAX framework is working out the bundle dependency from the maven
dependency.

I presume for your bundle application you are doing something like
that in the test, namely overriding the ServletContainer.

Paul.

> Let me know if you have any further questions!
> Rich