Wicket on Google’s App Engine

Posted April 10, 2009 by

Unless you’ve been living under a rock for the last week, you’ll probably have noticed that Google’s App Engine now lets you run Java web apps. This includes those created with Apache Wicket, although you’ll need to tweak a couple of settings to make it play nicely.

App Engine logo

The App Engine sandbox imposes some restrictions. The most notable of these is that you cannot run background threads. Here’s how to make Wicket play ball:

  • Make sure you’re running in deployment mode (this will disable the background thread that checks for modifications to your resource files, and is what you’ll want for deploying to a remote site like this anyway).
  • Override newSessionStore() in your WebApplication subclass and return a new HttpSessionStore(this). (The default DiskPageStore uses a background thread and writes files, neither of which are supported in the App Engine’s sandbox.)
  • Enable session support in appengine-web.xml.

App Engine for Java is in limited beta, but if you’ve been to the London Wicket Users Group at Google and would like me to wangle an account for you, please e-mail me (details on the About page).

Post Details

2 Opinions have been expressed on “Wicket on Google’s App Engine”. What is your opinion?

  1. lzap commented:

    Thanks for tip! Nice!!!

  2. Dean commented:

    There seems to be a stumbling block for any apps that use org.apache.wicket.util.lang.Objects.cloneModel() – it uses serialisation to clone a model, and is disallowed in GAE. I hit this when using tabs and links – the previous state is copied in this manner.
    I’ve got round it by altering the Objects object to catch the security exception and trying alternative methods (clone(), copy constructor) before giving up the ghost.
    Any ideas for a better way?
    Cheers!

Leave a Reply