Error while starting a GAE/GWT project: Unable to restore the previous TimeZone

user1115538 picture user1115538 · Mar 18, 2012 · Viewed 7.5k times · Source

When I try to run a GWT App Engine project using the Eclipse plugin, I get the following error:

Initializing App Engine server
[ERROR] Unable to start App Engine server
java.lang.RuntimeException: Unable to restore the previous TimeZone
    at com.google.appengine.tools.development.DevAppServerImpl.restoreLocalTimeZone(DevAppServerImpl.java:228)
    at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:164)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
    at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Caused by: java.lang.NoSuchFieldException: defaultZoneTL
    at java.lang.Class.getDeclaredField(Class.java:1899)
    at com.google.appengine.tools.development.DevAppServerImpl.restoreLocalTimeZone(DevAppServerImpl.java:222)
    ... 6 more
[ERROR] shell failed in doStartupServer method
Unable to start embedded HTTP server
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
    at      com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:102)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
    at com.google.gwt.dev.DevMode.main(DevMode.java:311)

Answer

klenwell picture klenwell · Apr 17, 2012

Chris Cashwell provided the correct answer. But for people like myself who are relatively new to Eclipse, here are more explicit instructions (which I came across here):

  1. Right-click project directory in Project Explorer window
  2. Select Run As > Run Configurations...
  3. Go to Arguments tab
  4. In VM Arguments textbox, add one of the following parameters mentioned by Chris:
    • -Dappengine.user.timezone.impl=UTC (this worked in my case)
    • -Dappengine.user.timezone=UTC
  5. Click Apply then Run

In my case, this was done specifically in the context of a PlayN project I am working on, so I was right-clicking the HTML folder. In the end, my VM arguments looked something like this:

-Xmx512m -javaagent:/long/path/to/appengine-agent.jar -Dappengine.user.timezone.impl=UTC