Reputation: 35276
I'm getting this error when running my GWT/GAE app:
java.lang.RuntimeException: Unable to restore the previous TimeZone at com.google.appengine.tools.development.DevAppServerImpl.restoreLocalTimeZone(DevAppServerImpl.java:348) at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:251) 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.NoSuchMethodException: java.util.TimeZone.setDefaultInAppContext(java.util.TimeZone) at java.lang.Class.getDeclaredMethod(Class.java:2117) at com.google.appengine.tools.development.DevAppServerImpl.restoreLocalTimeZone(DevAppServerImpl.java:344) at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:251) 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)
Although I added -Dappengine.user.timezone=UTC
and -Dappengine.user.timezone.impl=UTC
Upvotes: 1
Views: 236
Reputation: 10148
If you're getting java.lang.NoSuchMethodException error on JDK 8, its likely this bug https://github.com/GoogleCloudPlatform/gcloud-maven-plugin/issues/54
The solution discussed there is to add config to the appengine maven plugin.
<jvm_flag>
<jvm_flag>-Dappengine.user.timezone=UTC</jvm_flag>
</jvm_flag>
Passing the argume as -D does not work (nor adding .impl) as discuess in older solutions.
Upvotes: 2
Reputation: 35276
The error got fixed when I updated the GAE version from 1.8.0 to 1.8.8+
Upvotes: 0
Reputation: 2143
Try this.
TimeZone.setDefault(TimeZone.getTimeZone("GMT-05:00"));
for example this is for Bogota, Lima, Quito .. you can choose your Zone here
Upvotes: 1