Jersey 1.8 issue

764 views
Skip to first unread message

Yann Lambret

unread,
Jul 26, 2011, 5:57:54 AM7/26/11
to google-a...@googlegroups.com
Hello,

I'm trying to deploy a restful web service on GAE with Jersey 1.8 implementation. On the page 'will it run on appengine', there is no information about this specific release. I've set up the web.xml as indicated in the Jersey documentation :
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>net.whatever.rest</param-value>
</init-param>
</servlet>

My war/WEB-INF/lib directory contains the following files:

asm-3.1.jar
jackson-core-asl-1.7.1.jar
jackson-jaxrs-1.7.1.jar
jackson-mapper-asl-1.7.1.jar
jackson-xc-1.7.1.jar
jersey-client-1.8.jar
jersey-core-1.8.jar
jersey-json-1.8.jar
jersey-server-1.8.jar
jettison-1.1.jar
jsr311-api-1.1.1.jar

My REST class is annotated with @Path btu I still get these errors when accessing the application (deploying is ok):

Uncaught exception from servlet
javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at org.mortbay.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:415)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:458)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250

Or sometimes this additionnal error, depending on the content of my web.xml file:

com.sun.jersey.server.impl.application.RootResourceUriRules <init>: The ResourceConfig instance does not contain any root resource classes.

Did sommeone successfully manage to deploy a Jersey 1.8 app on GAE ? If so, could you please provide the related web.xml secttion,
code snippet or whatever could help ?

Thanks a lot.

Yann


Hugo Visser

unread,
Jul 27, 2011, 3:02:17 AM7/27/11
to Google App Engine
Hi Yann,

I'm running an older version of Jersey on app engine (1.3) which runs
fine.

One tip that I can give you is not to use classpath scanning as you do
now. Just create an Application and register that in your web xml
(it's easier to debug too). That will give you better start up
performance on App Engine.

If you do use classpath scanning, I hope you understand that your
resources should be in the package "net.whatever.rest" for Jersey to
find them?

Hugo

Yann Lambret

unread,
Jul 27, 2011, 4:13:55 AM7/27/11
to google-a...@googlegroups.com
Hi Hugo,

Thanks for your answer. I put indeed the right package name in the web.xml, I also tried with the parent packages but without success. I going to try your solution and let you know how it goes.

Yann

Yann Lambret

unread,
Jul 27, 2011, 2:34:12 PM7/27/11
to google-a...@googlegroups.com
Hugo,

It worked like a charm, thanks a lot for your help about this, you saved my day (week ?).

Cheers

Yann
Reply all
Reply to author
Forward
0 new messages