users@jersey.java.net

OSGi issues

From: Ángel Eduardo <egarcia_at_swissms.ch>
Date: Tue, 24 Aug 2010 11:05:12 +0200

  Hi!

I'm having a bit of trouble using Jersey with OSGi. I'm trying to deploy
a previous Glassfish V3 standard WAR app into an OSGi one, so I've
happily added a MANIFEST.MF file with some OSGi info and tried to deploy.

But Jersey (1.1.5 and 1.5, both tried) is complaining with
"com.sun.jersey.core.spi.scanning.ScannerException: The URI scheme
bundle of the URI bundle://282.0:2/com/example/myexample is not
supported.", so it seems that using
"com.sun.jersey.config.property.packages" param is not working (Jersey
don't know how to read OSGi URLs, it seems,a t least with this Jersey
version, 1.1.5 or 1.5, both of which I've tried). I've tried with other
"com.sun.jersey.config.property.resourceConfigClass" like
"com.sun.jersey.api.core.ClasspathResourceConfig" or
"com.sun.jersey.api.core.ClassNamesResourceConfig", neither of which work.

I've also tried to add the Jersey jars to my bundle and add every class
to Import-Packages of MANIFEST (I know, it's not pretty, but I'm a bit
exasperated right now :P) but it keep complaining about some
multipart.impl class it didn't found, even where it was in the
Import-Packages.

Anyway, I write to you, wise men :P, to know the right approach to make
Jersey (as OSGi bundle or not, I don't really care) found my root classes.

Thanks in advance!

-- 
Ángel Eduardo