Wicket on Google’s App Engine

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.

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).

3 thoughts on “Wicket on Google’s App Engine”

  1. 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?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>