Java for Google AppEngine, finally!

By Hari K. Gottipati
April 7, 2009 | Comments: 4

At last after one year, Google announced the availability of the Java for AppEngine platform. When the AppEngine announced last year, the very first issue filed was - a request for Java. Since then lots of Java developers want to see their favorite language supported by the AppEngine. To put an end to that, tonight at the Google campfire event, AppEngine team announced Java support and many improvements. It is in early access and AppEninge team is still working on the final product. Though it may take some time to finalize the product, it is worthy to look at it right away.

My first impression - it is outstanding. Eclipse plugin for AppEngine makes development and deployment very easy for the developers. Let's look at the features/limitations:

  • AppEngine supports both Java 5 and Java 6. Sorry, no JDK 1.4.
  • App Engine Java SDK includes a development web server for testing your application on your computer. The development web server simulates the App Engine Java runtime environment and all of its services, including the datastore.
  • App Engine Java SDK includes a command for interacting with App Engine. You can use this command to upload new versions of the code, configuration and static files for your app to App Engine.
  • You can also manage datastore indexes and download log data from a command line.
  • AppEngine has Eclipse plugin for developing and deploying the Java applications to AppEngine. As-you-type validation ensures that your code is compatible with App Engine.
  • With Eclipse plugin you can develop GWT application or AppEnigne application or the combination of both.
  • The Google Plugin for Eclipse can run the server in the Eclipse debugger.
  • For those who want to use Apache Ant, Java SDK includes a set of Ant macros to perform common App Engine development tasks, including starting the development server and uploading the app to App Engine.
  • In addition to the web.xml deployment descriptor, an App Engine Java application uses a configuration file, named appengine-web.xml, to specify the app's registered application ID and the version identifier of the latest code, and to identify which files in the app's WAR are static files (like images) and which are resource files used by the application.
  • The Java SDK includes implementations of the Java Data Objects (JDO) and Java Persistence API (JPA) interfaces, as well as a low-level datastore API to access the AppEngine's schemaless object datastore, with a query engine and atomic transactions.
  • Distributed in-memory data cache - memcache is supported via Memcache Java API implements the JCache interface (javax.cache), a draft standard described by JSR 107.
  • App Engine provides the ability to manipulate image data using a Images Java API.
  • App Engine applications can authenticate users with Google Accounts via Java API for Google Accounts.
  • JUnit support and you can unit test datastore too.
  • Deployment descriptor(web.xml) is pretty much standard one, except :
    • App Engine supports the <load-on-startup>. However, the load actually occurs during the first request handled by the web server instance, not prior to it.
    • App Engine supports <mime-mapping> elements for specifying the MIME type to use for resources whose filenames end with certain extensions. However, MIME mappings only apply to servlets, not to static files. Static files use a fixed list of mappings of filename extensions to MIME types.
    • App Engine doesn't support JNDI environment variables (<env-entry>).
    • App Engine doesn't support EJB resources (<resource-ref>).
    • The <distributable> element is ignored.
    • Servlet scheduling with <run-at> is not supported.
  • On top of the AppEngine quota limits, the following limits are specific to the Java applications:
    • request size - 10 megabytes
    • response size - 10 megabytes
    • request duration - 30 seconds
    • simultaneous dynamic requests - 30
    • maximum number of application files - 1,000
    • maximum number of static files - 1,000
    • maximum size of an application file - 10 megabytes
    • maximum size of a static file - 10 megabytes
    • maximum total size of all application and static files - 150 megabytes

Besides Java, they also introduced some new features:

  • Cron job support.

  • Uploading data from CSV file to datastore.

  • Secure Data Connector (SDC) to access the data behind the firewall.

I am not sure how well people receive the SDC and allow AppEngine application to access the data behind the firewall, but other 2 feature are so helpful.

In my earlier post, I reviewed other Java Paas(Platform as a service) provider Stax - but it doesn't have plugin to develop and deploy the Java applications. In contrast, Google made the development and deployment easy with the plugin for the widely used Java IDE, Eclipse.

Update: AppEngine is limited to some classes from the Java standard library. This is a major limitation and it would be the real hurdle for Java developers to jump onto AppEngine. Click here to see the list of classes allowed in AppEngine application.

Update 2:Google also building a page "Will it play in App Engine", to list compatible Java tools and frameworks.

You might also be interested in:


Missed one very important limitation: No threads

Java based PaaS is already available on Amazon EC2 with the power and openness that EC2 provides.

Yes, but you can run your app on google app engine for free, whereas amazon requires a fee, then charges you for all bandwidth usage.

News Topics

Recommended for You

Got a Question?