maxieduncan

Sunday, 25 October 2009

Using the Google Data API on the Google App Engine

Disabling the Cookie Handler is no longer required
Issue 122 has been fixed and you no longer have to disable the Cookie Handler (as I mentioned before) to use the Goole Data API in the Google App Engine.

Google Data API on the Google App Engine

Enabling support for the Google Data API on the Google App Engine is really straight forward and is covered by google in their documentation:

Add the following to your appengine-web.xml file:

<system-properties>
  <property name="com.google.gdata.DisableCookieHandler" value="true"/>
<system-properties>

If the following is not included, you may see the following exception:

java.security.AccessControlException: access denied (java.net.NetPermission getCookieHandler)

In my case the exception that I noticed was a java.lang.NoClassDefFoundError: Could not initialize class com.google.gdata.client.http.GoogleGDataRequest but this had been preceded by the java.security.AccessControlException.


Grail AppEngine plugin


As I'm using Grails and the Grail AppEngine plugin things got a little more complicated however. The plugin automatically generates the appengine-web.xml file and their is currently no way specify system properties to be included (there is an Improvement request that would add this support).  


In order to add the system property I had to edit the _Events.groovy file in ~/.grails//projects//plugins/app-engine-0.8.5/scripts/_Events.groovy and manually paste in the change that I required. While this works, an update to the plugin will obviously wipe the changes that I've made and they would have to be applied again.

No comments:

Post a Comment