Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i use Spring on GAE?

Can i use Spring Webflow/MVC and Spring Security and Hibernate on Google App Engine?

Is there a list/summary of java frameworks that can be used on the GAE?

like image 952
n002213f Avatar asked Apr 16 '10 15:04

n002213f


2 Answers

Will it Play In Java lists frameworks, languages and libraries that work (or not) in Google App Engine. At present, the information listed is:

Spring MVC

Version     2.5.6
Status  COMPATIBLE

To see Spring's MVC framework running on App Engine, check out the autoshoppe sample application. If you're using Spring forms (e.g. using the spring-form.tld tag library and subclassing SimpleFormController), you will need to register custom editors for your properties. This is covered in http://groups.google.com/group/google-appengine-java/browse_thread/thread/d93fd7385bf85bf7.

Spring ORM

Version     2.5.6
Status  COMPATIBLE

To get Spring working with the App Engine-provided JPA interface, follow the instructions at http://objectuser.wordpress.com/2009/05/19/spring-jpa-in-google-app-engine/, which discusses a workaround to the dependency on javax.naming needed for @PersistenceContext. A more complex workaround is available at http://groups.google.com/group/google-appengine-java/browse_thread/thread/187d41712ec1d394.

Spring Security

Version(s)  ?
Status  SEMI-COMPATIBLE

To work around a ClassNotFoundException, you can use a re-compiled version of the library which adds a StringInsensitiveComparator class -- the download is provided at http://www.google-app-engine.com/blog/post/Spring-security-fix-for-google-app-engine.aspx. See http://www.dotnetguru2.org/bmarchesson/index.php?p=1100 for tips on how to get Spring Security running with App Engine and GWT (in French). See http://groups.google.com/group/google-appengine-java/browse_thread/thread/964e7f5e42840d9c for discussion on the integration.

Hibernate

Versions     All
Status  INCOMPATIBLE

You cannot currently use Hibernate directly. The differences between the App Engine datastore and SQL were too great to get the standard Hibernate up and running under App Engine. App Engine does support JDO and JPA, so you may be able to convert your Hibernate code to use one of these ORM interfaces.

I suppose that it should work with Spring 3.0 too, I will try soon and share the results.

UPDATE: I tried a Spring MVC Hello World with Spring 3.0.6 with Google App Engine and it worked perfectly, both locally and in the cloud. The drawback though, is longer load time when a new instance starts.

like image 128
stivlo Avatar answered Sep 19 '22 14:09

stivlo


As far as I know, no third party libraries are supported (at least none are listed), and JRE classes are limited to this list. But I guess if a library only makes use of the listed jre classes, they should be fine. However, finding out if they do would have to be based on trying it out.

like image 27
Klaus Byskov Pedersen Avatar answered Sep 18 '22 14:09

Klaus Byskov Pedersen