Restlet in the cloud with Google App Engine! April 11, 2009
Posted by Jerome Louvel in Restlet.trackback
We are living exciting times! This week, Google has released an early version of their widely expected support for Java in Google App Engine (GAE).
GAE is a computing platform that can host your Web applications and offer them massive and flexible scalability. Free accounts are available and you can pay for extra resources (CPU time, bandwidth, storage and mails sent).
Of course, REST is the perfect choice to build your Web applications that will live in the Google cloud. But, GAE achievements come with constraints because you share computing resources with others. So GAE makes you live in a sandbox with a limited set of Java APIs.
The great news is that Restlet has just been adapted to fully work with GAE! This port provides in a single “org.restlet.gar.jar” file:
- Full Restlet API
- HTTP(S) server via the built-in Servlet adapter
- HTTP(S) client via the built-in adapter to java.net.HTTPUrlConnection
- SMTP client via the built-in adapter for JavaMail
- Server-side GWT support via the built-in GwtShellServletWrapper class.
In addition, support for GWT is available in both GAE and Restlet (see this post on our port of Restlet on GWT). The usage instructions are available in our online User Guide.
Google France provided us the early access to GAE after their launch event in Paris last Thursday, in collaboration with Didier Girard, Technical Director at SFEIR and author of the OnGWT web site.
Thanks to all of them and to Guillaume Laforge (who ported Groovy to GAE) for their advices and help making this port a reality so quickly and for sharing their passion for GAE!
Update:

Interesting to try this. working GWT and RESTlet .. wonderful combination on GAE. Looking for serious Enterprise application development with this combination ..
[...] REST Restlet in the cloud with Google App Engine [...]
I am currently looking for a REST framework that runs on GAE – and Restlet looks very promising. However, I am also interested in Spring support. Is there a chance to get this with Restlet for GAE?
Stefan,
We have a Spring extension that should work on GAE as well. I haven’t tested it yet, but would be happy to make a special version or adjust it if necessary.
Best regards,
Jerome
Hi Jerome,
thanks for your reply. I adjusted the Spring extension to work with the GAE jar (only had to change the ServerServlet import in SpringServerServlet).
Is this extension supposed to work with ServerResources (yet)? I got it working by overwriting some methods in SpringFinder, but I am not sure that I’m on the right track.
I also had to create a customized ServletCall, as getSubject() caused an exception (due to GAE restrictions on Subject.getPrincipals().add(Principal)) as soon as getRequest().getUserPrincipal() != null. The solution was to pass the Principal to the constructor of Subject instead.
[...] computers based on Java SE/EE, in Web browers with our GWT edition and even in the cloud with a new Google AppEngine edition. But, we are still missing the Mobile [...]
Hi Stefan,
I’ve just made a fresh port of Restlet to GAE. See the SVN trunk. This will give you full support for the new ServerResource classes.
Note that packages have changed again to their original name (for ServerServlet).
Thanks,
Jerome
I cannot seem to find the ServerServlet class in the GAE jar, where is it located?
Hi Mylo,
It is in the “org.restlet.ext.servlet” package.
Best regards,
Jerome
Hi Jerome,
That package doesn’t exist. I have downloaded the latest GAE jar and the only packages under “org.restlet.ext” is javamail, net and xml.
If I download the source files it is there, but its not in the jar. Can you check if its been missed out.
Thanks
Mylo,
Thanks for the report, that’s correct.
We had a failing test case preventing the generation of new snapshots. This is fixed now in SVN and should we pushed to the Web site by tomorrow.
Best regards,
Jerome
Hi Jerome,
Maybe it was meant to be in the GAE jar, however I found a org.restlet.ext.servlet jar and included that in my build path as well as the GAE jar and now it works.
I am guessing this is fine, it will work when I upload to the App Engine right?
Mylo,
I should definitely work, no more code differences between the port and the main trunk for this extension.
Cheers,
Jerome
[...] packages and with the growing number of special Restlet editions (Java SE/EE, Google Web Toolkit, Google App Engine and Android), it seemed appropriate to rename the Restlet 1.2 branch into Restlet [...]
[...] for each edition that we support: Java SE, Java EE (with Servlet support), Google Web Toolkit, Google App Engine and Android. In addition, the porting of the main source code base to each edition is now fully [...]
Hi
I am testing Restlet in GAE but it does not work localy (inside eclipse)
My conf :
eclipse 3.5.1.M20090917-0800
GAE 1.2.6 App Engine
Restlet 2.0M5
I have tried the example at http://wiki.restlet.org/docs_1.2/13-restlet/275-restlet/252-restlet.html
But I am stuck with :
The server is running at http://localhost:8080/
19 nov. 2009 15:22:19 org.restlet.routing.Filter doHandle
WARNING: A filter was executed without a next Restlet attached to it.
Hi Frank,
The Wiki link you mentions refers to a deprecated version of the documentation (Restlet 1.2 is now 2.0). Try this page instead:
http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/252-restlet.html
You are facing a regression in 2.0 M5 fixed in recent snapshots. A workaround is to override createInboundRoot() instead of createRoot().
Cheers,
Jerome
OK.
The lastest snapshot resolved my problems.
Thanks
Franck
[...] Google App Engine (GAE/J) for deployment on Google’s cloud computing infrastructure [...]