我已經將我的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