users@jersey.java.net

Re: [Jersey] JBoss5 problem with Jersey 1.0.3

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 18 Jun 2009 12:11:52 +0200

Hi William,

Are you deploying resources classes in a jar in WEB-INF/lib ?

The issue was fixed for the scheme of "vfsfile" but not for a scheme
of "vfszip".

Looking at the URL:

   vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/example-rs.ear/
example-rs.war/WEB-INF/lib/example-rs-impl.jar/org/example/rs/

I am not sure how to interpret it, "vfszip" it is a proprietary URL
scheme specific to JBoss. We managed to interpret "vfsfile" as "file",
but we are relying on an implementation detail that could change.

I am guessing frameworks like Struts, which does scanning, will have
similar issues.

I dunno what to do about this, apart from make the scanning algorithm
plug-able per the URI scheme, and there can be a plugin to support the
JBoss vfs-based schemes.

Paul.


On Jun 18, 2009, at 10:18 AM, William Zhou wrote:

> Hi,
>
> I met a problem when deploying a Jersey based project in JBoss AS
> 5.0.1.GA. The exception was:
>
> 03:14:56,344 ERROR [STDERR] Jun 18, 2009 3:14:56 AM
> com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> org.example.rs
> 03:14:56,360 ERROR [STDERR] Jun 18, 2009 3:14:56 AM
> com.sun.jersey.server.impl.container.config.AnnotatedClassScanner
> index
> WARNING: URL, vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/
> example-rs.ear/example-rs.war/WEB-INF/lib/example-rs-impl.jar/org/
> example/rs/, is ignored, it not a file or a jar file URL
> 03:14:56,953 ERROR [STDERR] Jun 18, 2009 3:14:56 AM
> com.sun.jersey.server.impl.application.WebApplicationImpl
> processRootResources
> SEVERE: The ResourceConfig instance does not contain any root
> resource classes.
> 03:14:56,953 ERROR [[/resources]] StandardWrapper.Throwable
> com.sun.jersey.api.container.ContainerException: The ResourceConfig
> instance does not contain any root resource classes.
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.processRootResources(WebApplicationImpl.java:718)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:590)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:383)
> at
> com
> .sun
> .jersey
> .spi
> .container.servlet.ServletContainer.initiate(ServletContainer.java:
> 377)
> at com.sun.jersey.spi.container.servlet.ServletContainer
> $InternalWebComponent.initiate(ServletContainer.java:242)
> at
> com
> .sun
> .jersey.spi.container.servlet.WebComponent.load(WebComponent.java:449)
> at
> com
> .sun
> .jersey.spi.container.servlet.WebComponent.init(WebComponent.java:169)
> at
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 281)
> at
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 442)
> at javax.servlet.GenericServlet.init(GenericServlet.java:212)
> at
> org
> .apache
> .catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
> 950)
> at
> org
> .apache
> .catalina.core.StandardContext.loadOnStartup(StandardContext.java:
> 4122)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:
> 4421)
>
> My Jersey servlet configuration is as following:
> ...
> <servlet>
> <servlet-name>Sample Resources</servlet-name>
> <servlet-
> class>com.sun.jersey.server.impl.container.servlet.ServletAdaptor</
> servlet-class>
> <init-param>
> <param-name>com.sun.jersey.config.property.packages</
> param-name>
> <param-value>org.example.rs</param-value>
> </init-param>
> <init-param>
> <param-name>com.sun.jersey.config.feature.Redirect</
> param-name>
> <param-value>false</param-value>
> </init-param>
> <load-on-startup>0</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>Sample Resources</servlet-name>
> <url-pattern>/sample/*</url-pattern>
> </servlet-mapping>
> ...
>
> This package is deployed successfully in JBoss 4.x. I note that this
> issue was fixed in Jersey 1.0.1. It should not reproduce again. Did
> I configure wrongly somewhere?
>
> Thanks,
> William
>
>
>
>