Earthly Powers

Monday Nov 30, 2009

Jersey apps can now be deployed to Google App Engine

OK, it's not very exciting but you can go to the URL http://jersey-jax-rs.appspot.com/test/resource and should be able to receive the same response, including the trace headers i previously talked about.

I wanted to upload the Sparklines sample but the AWT graphics stuff is currently blacklisted (like java.awt.image.BufferedImage).

When you deploy a Jersey application to GAE you will currently get some errors in the logs in the logs such as:

com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider: 
The provider class, class com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App, 
could not be instantiated. Processing will continue but the class will not be utilized

This is because Jersey cannot load the JAXB-related components as JAXB related classes are currently black listed. As i understand JAXB will be supported in Google App Engine version 1.2.8. So these deployment errors will go away.

The code is in the trunk and should take a couple of hours for artifacts to be pushed to the repo.

Comments:

[Trackback] This post was mentioned on Twitter by Paul Sandoz: Jersey/JAX-RS apps can now be deployed to Google App Engine: http://bit.ly/8xbhY3

Posted by uberVU - social comments on November 30, 2009 at 11:42 AM CET #

Paul - can't thank you enough. Today's snapshot version (I used jersey-bundle-1.1.5-ea-SNAPSHOT.jar) works perfectly with my current application, in the developer environment and deployed to live Google App Engine hosting.

For an existing Restlet based JAX-RS application, I replaced only the Servlet mapping to Jersey's, with no changes to registered Resources and Providers in my Application class, and it worked first time. Great stuff. A Google GSON JSON provider and a custom MVC style templating provider using Google Closure Templates carried on working happily with Jersey.

Thanks again.

Posted by Andy on December 01, 2009 at 12:19 AM CET #

Hi Andy,

Great news. Thanks for verifying.

If you ever blog about your app such as the use of the Google GSON JSON provider and the MVC template provider let me know. Sounds interesting!

Paul.

Posted by Paul Sandoz on December 01, 2009 at 08:43 AM CET #

Hi,
Today, the new release of Google app engine is out. And it supports JAXB.
I am so glad I can use now Jersey on GAE. To me, Jersey (+supports of Viewable) and GAE is one of the best platform I can even dream of. I just now need to learn how to persist objets and... Many things will happen!

Posted by Gabriel Kastenbaum on December 04, 2009 at 06:45 AM CET #

@Gabriel
You can persist object EASY with Objectify

http://code.google.com/p/objectify-appengine/

I've also written a tutorial that uses GWT UiBinder with Jersey and Objectify at

http://wp.me/PnkVx-1S

Posted by Iqbal Yusuf on February 04, 2010 at 08:15 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed