我已经将我的Google App Engine应用程序移植到最近的Java 8运行时环境中。该应用程序工作正常,有几个问题。Java 8上的Google App Engine - dev上的java.time不可用。服务器?
我已经移植我的代码使用java.time而不是乔达时间,但响应请求时,应用程序引擎服务器抛出错误:
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)
这发生在开发服务器上只,生产服务器似乎运行良好。
- 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.
当这个错误搜索,我发现提到文件访问被禁止的,我理解,但我看不出如何适用于java.time
包。此外,我发现的提及(如此SO question)似乎是关于Java 7运行时环境。
这不是很紧迫,我可以留在乔达的时间,但这对我来说是一个惊喜。
这是预期的,还是一个错误,或者我做错了什么?
有趣的听到,谢谢。我跟着你的清单,到目前为止运气不是很好:Dev Server运行在Java \ jdk1.8.0_92 \ bin上,WEB-INF/lib包含appengine-api-1.0-sdk-1.9.54.jar,appengine-web.xml包含 java8 。我的构建环境有点不寻常,我使用的是Scala,IntelliJ IDEA和SBT,但我认为这不应该在这里扮演任何角色。您是否使用App Engine SDK或新的Cloud SDK? –
Suma