84

I would like to create a RESTful app on Google App Engine. I would like to provide XML and JSON services. I have briefly experimented with Restlet, Resteasy, and Jersey. I haven't had much success with any of them, other than some simple examples in Restlet.

Could you share your experiences creating a Restful web application on Google App Engine using Java or provide any insight on the aforementioned toolkits on GAE?

Thanks!

Edit (2009-07-25):

I have decided to use Restlet for the time being. It seems to work flawlessly so far. Please post any other insights/opinions you may have. What problems have you encountered? Have you successfully used Jersey/Restlet/Resteasy on GAE/J? If so, we want to hear about it!

Jim Ferrans
  • 30,582
  • 12
  • 56
  • 83
JP Richardson
  • 38,609
  • 36
  • 119
  • 151
  • http://technicalrex.com/2014/08/11/creating-a-jersey-app-on-google-app-engine/ and http://www.javacodegeeks.com/2012/05/google-app-engine-jax-rs-rest-service.html are the best turorial about Jersey GAE integration. – Md. Sajedul Karim Oct 17 '15 at 06:57
  • Its a matter of choice of the framework we are used to in our development, I have been using Spring MVC with objectify as well Hibernate and it also work flawlessly on Google App Engine. – Ankur Jain Jun 04 '16 at 08:47
  • @AnkurJain yes, a lot changes in 7 years. – JP Richardson Jun 04 '16 at 20:10

10 Answers10

45

I'm happy to report that Restlet M3 works FLAWLESSLY on AppEngine 1.2.2. I have followed the "First steps" and "First resource" tutorials found http://restlet.com/technical-resources/restlet-framework/guide.

So, it seems to me that Restlet is the answer for your GAE/J Restful applications.

Peter
  • 5,556
  • 3
  • 23
  • 38
JP Richardson
  • 38,609
  • 36
  • 119
  • 151
17

I'm using Jersey on GAE. Here is the link for those who are interested about setting it up: (I'm using GAE SDK v1.4.0):

http://tugdualgrall.blogspot.com/2010/02/create-and-deploy-jax-rs-rest-service.html

Viren
  • 2,161
  • 22
  • 27
  • 2
    The above link covers Jersey 1.1.5. The GAE team maintain notes on this and later versions here - https://code.google.com/p/googleappengine/wiki/WillItPlayInJava#Jersey – George Hawkins Apr 22 '14 at 15:39
6

I am going to begin exploring this as well, but haven't started yet. I did find this framework, that says it should work, but like I said haven't tried it yet.

http://wiki.restlet.org/docs_1.2/13-restlet/275-restlet/252-restlet.html

If you get it working, or manage to get one of the above suggestions working, update everyone as I am sure there is interest in this.

broschb
  • 4,976
  • 4
  • 35
  • 52
  • 1
    I'm pretty sure Restlet will work. It's just a bit nastier to use than the others. I particularly like the annotations that Jersey introduces. I plan on using Restlet within the next couple of weeks. I'll be sure to post an update. – JP Richardson Jul 17 '09 at 21:23
  • I spent the weekend playing around with this as well, And Restlet works great on GAE. I was able to put something together following the example given on the Restlet site at the url I left previously that is now down. But it was trivial to set everything up. – broschb Jul 27 '09 at 16:24
  • I wrote a small post on my blog to answer another question on stackoverflow. It goes through a very basic example of getting restlet going on GAE. http://broschb.blogspot.com/2009/08/restful-service-on-google-app-engine.html – broschb Aug 08 '09 at 18:22
  • 1
    Restlet now has a JAX-RS implementation. They've also begun distributing builds specifically for use on AppEngine. You'll want to use the latest 2.0 milestone (currently 2.0m4). I've just set this up as a proof of concept for a new app that's being built now. I would not recommend using Restlet's own API as it's radically generic, overly abstracted, and just generally confusing. http://www.restlet.org/downloads/2.0/restlet-gae-2.0m4.zip – Mark Renouf Sep 18 '09 at 10:59
  • http://stackoverflow.com/questions/2157857/rest-on-gae-what-implementation-to-userestlet-jersey-other – Jasper Feb 28 '10 at 08:45
5

I'm using Restlet together with Guice on Google AppEngine. IMHO they fit together very well. See my recent blog post for further details: http://haraldpehl.blogspot.com/2009/11/google-appengine-restlet.html

Harald
  • 71
  • 1
  • 1
3

Since these valiant older solutions were patched together, Google has apparently supplied an Eclipse plugin to create a starter project that produces an App Engine app, an Android APK, and a Web app, all talking to one another over an interface defined by a single set of annotated object declarations.

Haven't tried this yet myself, but do have a look before trying any of the more heterogeneous examples described in the earlier messages above:

https://developers.google.com/eclipse/docs/appengine_connected_android

This Google video is also quite informative:

http://www.youtube.com/watch?v=NU_wNR_UUn4

Carl
  • 15,445
  • 5
  • 55
  • 53
2

For what it's worth, there has been quite a bit of discussion on Jersey user lists wrt how to make Jersey work on GAE. It is bit tedious work due to GAE restrictions (missing classes from white lists -- hopefully resolved over time), but apparently can be made to work. So while not trivially easy, that might be your best bet; esp. since many of the problems faced are the same for all frameworks (imposed by GAE).

StaxMan
  • 113,358
  • 34
  • 211
  • 239
  • i would like to ask you if u have any solution to my question here http://stackoverflow.com/questions/32699420/url-parameters-are-not-being-passed-by-curl-post thank u – Marco Dinatsoli Sep 23 '15 at 13:11
2

I recently put together a project template with Jersey, Guice and AppEngine at GitHub. It has been developed with SimpleDS, but it can be modified to work with Objectify / JDO easily. The project is live here.

It should be a good starting point for new projects.

Nacho Coloma
  • 7,070
  • 2
  • 40
  • 43
2

Well, I would highly advice you to have a look at play framework

Have a look at the video on the homepage

It has a gae module

With siena as a orm to handle gae datastore

From all the java frameworks I've seen so far, I think it has the easier learning curve,

  • great documentation,

  • a tutorial to develop a complete application

  • very active and helpfull community,

  • free as in beer and also as in speech

  • highly scalable due to it's stateless out of the box design

  • rest friendly

  • highly customizable via it's modules and plugin approach

more over, taking into account it's for a college course, it's really easy to hack into the code, I could handle a couple of tickets and new features without any experience at all with java, just a couple of year developing web applications with php

other benefits

  • it's really easy to start, no complicated setup involved, just download and unzip the file and your are ready

  • great development experience, just fix the code and hit refresh, play autocompiles changes on the fly when running on development mode

  • fast and lightweight

  • fullstack, you don't have to integrate cumbersome frameworks to make it work

  • great errors report, no more endless error stack trace, just shows you the line with error

  • no xml configuration anywhere around

  • great support for tdd with selenium integrated test

I think the main advantage as a learning tool, is that it's possible to peek into the source code without feeling lost and the community support... The documentation is very clear, and you can learn a lot by just having a look at the source code...

opensas
  • 60,462
  • 79
  • 252
  • 386
  • Play looks very impressive. However, its integration with GAE doesn't look like its maintained within the main project and thus lags behind GAE's release cycle. Its GWT plugin seems to lag even further. None the less, I'll give you an upvote for showing me such a cool project. – JP Richardson Mar 30 '11 at 14:19
  • the gae module was developed and is mantained by the main developer, siena module (recommended orm for gae, jpa has lots of troubles) is mantained by a very active member of the community, unfortunately the gwt module doesn't get that much attention in deed... – opensas Mar 31 '11 at 06:27
  • gae module is back on track! another developer took charge of it, here's support fot gae 1.6 http://www.playframework.org/modules/gae-1.6.0/home – opensas Feb 19 '12 at 15:08
1

Here is a very very good tutorial Restlet/Android/GAE/Objectify with an example of a simple application. Sorry it's in french, but you can juste copy/paste the code, or use google traduction.

I followed it and had a working Android / GAE server communicating together in a 2 hours. It's a good base to start or test Restlet.

http://www.tutos-android.com/webservice-rest-android-appengine-restlet-objectify

Good Luck

Tyvain
  • 2,640
  • 6
  • 36
  • 70
-1

The 2 most cumbersome GAE REST API actions to make work, whether Java or .py, are graphics and how to undisplay private information. My little gae rest feed forked another project. I'm sure Java succeeds where python stuck due to the Java takes and gives more ways (advantages) as well as longer (slower) time to succeed (disadvantage) while python projects opens less ways to succeed (disadvantageous) and less development time (advantageous rapid development) to succeed the same.

Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424