I have ported my Google App Engine application to recent Java 8 runtime environment. The application works fine, with a few issues.
I have ported my code to use java.time instead of Joda time, but the app engine server throws error when responding to requests:
java.lang.NoClassDefFoundError: java.time.ZonedDateTime is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:50)
This happens on a development server only, production server seems to be running fine.
The documentation says:
- Doesn't impose a security manager as the Java 7 runtime does, which means your code won't be restricted by Java permissions issues.
- Supports the standard public Java library, not just the whitelisted class subset available for the Java 7 runtime.
When searching for this error, I found mentions about file access being prohibited, which I understand, but I do not see how this applies to java.time
package. Moreover, the mentions I have found (like this SO question) seem to be about Java 7 runtime environment.
It is not very pressing, I can stay with Joda time, but it was a surprise for me.
Is this expected, or is it a bug, or am I doing something wrong?