users@jersey.java.net

Re: [Jersey] com.sun.jersey.core.spi.scanning.ScannerException: T he URI scheme bundle of the URI bundle://88.0:1/org/apache/camel/web is n ot supported. Package scanning deployment is not supported for such URIs.

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 12 Jan 2010 14:25:48 +0100

On Jan 11, 2010, at 11:14 AM, cmoulliard wrote:

>
> Hi Paul,
>
> I have tried to get more info from TRACING without success. For your
> information, here is what we have done in your camel application.
>
> 1) Web.xml
>
> We have defined a class and define it in the web.xml filter as
> com.sun.jersey.config.property.resourceConfigClass
>
> <init-param>
>
> <param-name>com.sun.jersey.config.property.resourceConfigClass</
> param-name>
>
> <param-value>org.apache.camel.web.util.CamelResourceConfig</param-
> value>
> </init-param>
>
> 2) This class contains the following info :
>
> public class CamelResourceConfig extends PackagesResourceConfig {
>
> public CamelResourceConfig() {
> super(createProperties());
> }
>
> protected static Map<String, Object> createProperties() {
> Map<String, Object> properties = new HashMap<String, Object>();
>
> properties.put(PackagesResourceConfig.PROPERTY_PACKAGES,
> "org.apache.camel.web");
>
> WadlGeneratorConfig config = WadlGeneratorConfig
> .generator(WadlGeneratorApplicationDoc.class)
> .prop("applicationDocsFile",
> "classpath:/application-doc.xml")
> .generator(WadlGeneratorGrammarsSupport.class)
> .prop("grammarsFile", "classpath:/application-
> grammars.xml")
> .generator(WadlGeneratorResourceDocSupport.class)
> .prop("resourceDocFile", "classpath:/resourcedoc.xml")
> .build();
>
> properties.put(ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG,
> config);
> return properties;
> }
>
> public Map<String, MediaType> getMediaTypeMappings() {
> Map<String, MediaType> m = new HashMap<String, MediaType>();
> m.put("html", MediaType.TEXT_HTML_TYPE);
> m.put("xml", MediaType.APPLICATION_XML_TYPE);
> m.put("json", MediaType.APPLICATION_JSON_TYPE);
> m.put("dot", MediaType.valueOf(Constants.DOT_MIMETYPE));
> return m;
> }
> }
>
> Questions :
> - I suppose that the issue comes from the fact that Jersey is not
> able to
> load xxx.xml files ?

No. Jersey does not know how to process URIs such as:

   bundle://88.0:1/org/apache/camel/web

to scan for classes.

It might be that we need a different ResourceConfig extending class
for OSGi bundle?


> - If Jsersy is able to work with Glassfish 3 as OSGI bundles, why
> does it
> not work with Felix ?
>

GF has a special mode of class loading for modules (bundles supplied
with GF) and deployed Web applications.

Paul.