启动本地的标准 App Engine 遇到了问题 – 无法启动

huangapple go评论138阅读模式
英文:

Starting App Engine Standard at localhost has encountered a problem - failed to start

问题

我已经在我的计算机上安装了OpenJDK:在命令行中运行java -version会产生以下输出:

C:\java -version
openjdk version "13" 2019-09-17
OpenJDK Runtime Environment (build 13+33)
OpenJDK 64-Bit Server VM (build 13+33, mixed mode, sharing)

(我怀疑openjdk 13是根本问题,但由于似乎没有明显的方法可以使用较旧的JDK,比如8,我希望Eclipse和Google能够在最新版本的openjdk下运行。)

我安装了适用于企业Java开发者的Eclipse IDE 2020-06(4.16.0)。

我立即前往Eclipse Marketplace并安装了Google Cloud Tools for Eclipse 1.8.3。我等了几分钟,直到安装完成。

然后我收到通知需要Google Cloud SDK,并且安装将立即开始。我等待安装完成。

为了验证安装,我创建了一个新的Google App Engine标准Java项目,它生成了一个基本的Hello World网页和相应的Servlet。我没有更改任何代码、配置或首选项。

我尝试通过选择DEBUG AS > APP ENGINE来验证功能。

几秒钟后,显示了一个错误对话框,上面写着:

'正在 localhost 上启动App Engine标准' 遇到了问题。
服务器 localhost 上的App Engine标准启动失败。

点击详细信息按钮会提供相同的信息。

控制台窗格中显示了以下内容:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.appengine.tools.development.StreamHandlerFactory (file:/C:/Users/Jeff.Thurston/AppData/Local/google/ct4j-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib/impl/appengine-local-runtime.jar) to method java.net.URL.getURLStreamHandler(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.google.appengine.tools.development.StreamHandlerFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.RuntimeException: Unable to create a DevAppServer
    at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:369)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:301)
    at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:383)
    at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:45)
    at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:257)
    at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:248)
Caused by: java.lang.ExceptionInInitializerError
    at com.google.appengine.tools.development.DevAppServerImpl.<init>(DevAppServerImpl.java:124)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
    at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:354)
    ... 5 more
Caused by: java.lang.IllegalStateException: java.lang.NoSuchMethodException: java.net.SocksSocketImpl.<init>()
    at com.google.appengine.tools.development.DevSocketImplFactory.<clinit>(DevSocketImplFactory.java:76)
    ... 12 more
Caused by: java.lang.NoSuchMethodException: java.net.SocksSocketImpl.<init>()
    at java.base/java.lang.Class.getConstructor0(Class.java:3350)
    at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2554)
    at com.google.appengine.tools.development.DevSocketImplFactory.<clinit>(DevSocketImplFactory.java:72)
    ... 12 more
英文:

I already have OpenJDK installed on my machine: java - version at the CLI produces the following:

C:\java -version
openjdk version &quot;13&quot; 2019-09-17
OpenJDK Runtime Environment (build 13+33)
OpenJDK 64-Bit Server VM (build 13+33, mixed mode, sharing)

(I suspect that openjdk 13 is the root problem, but since there is no apparent way to use a older JDK, such as 8, I am hoping that Eclipse and Google will run under the most current version of openjdk.)

I have a fresh install of Eclipse IDE for Enterprise Java Developers 2020-06 (4.16.0).

I immediately went to the Eclipse Marketplace and installed Google Cloud Tools for Eclipse 1.8.3. I waited several minutes for the installation to complete.

I then received a notification that Google Cloud SDK was needed and that installation would begin momentarily. I waited for this to complete.

To verify the installation, I created a new Google App Engine Standard java project, which generated a basic Hello World web page and corresponding servlet. I did not alter any code, configuration, or preferences.

I attempted to verify functionality by selecting DEBUG AS > APP ENGINE.

After a few seconds, an error dialog was displayed stating:

'Starting App Engine Standard at localhost' has encountered a problem.
Server App Engine Standard at localhost failed to start.

Clicking the Details button provide the same information.

The following was displayed in the console pane:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.appengine.tools.development.StreamHandlerFactory (file:/C:/Users/Jeff.Thurston/AppData/Local/google/ct4j-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib/impl/appengine-local-runtime.jar) to method java.net.URL.getURLStreamHandler(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.google.appengine.tools.development.StreamHandlerFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.RuntimeException: Unable to create a DevAppServer
	at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:369)
	at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:301)
	at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:383)
	at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:45)
	at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:257)
	at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:248)
Caused by: java.lang.ExceptionInInitializerError
	at com.google.appengine.tools.development.DevAppServerImpl.&lt;init&gt;(DevAppServerImpl.java:124)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:354)
	... 5 more
Caused by: java.lang.IllegalStateException: java.lang.NoSuchMethodException: java.net.SocksSocketImpl.&lt;init&gt;()
	at com.google.appengine.tools.development.DevSocketImplFactory.&lt;clinit&gt;(DevSocketImplFactory.java:76)
	... 12 more
Caused by: java.lang.NoSuchMethodException: java.net.SocksSocketImpl.&lt;init&gt;()
	at java.base/java.lang.Class.getConstructor0(Class.java:3350)
	at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2554)
	at com.google.appengine.tools.development.DevSocketImplFactory.&lt;clinit&gt;(DevSocketImplFactory.java:72)
	... 12 more

答案1

得分: 0

我在这个类似于你情况的回答中找到了建议从Java 8迁移到Java 11的信息,可以使用这个文档,希望对你有帮助。

英文:

I found this answer to a case similar to yours where it is recommended to migrate from java 8 to java 11 using this documentation, hope it helps.

答案2

得分: 0

App Engine标准开发服务器仅支持Java 8。您可以从诸如AdoptOpenJDK.net、Azul的Zulu等多个地方下载Java 8 JRE(或JDK)。

在安装了Java 8 JRE之后,您需要配置Eclipse以便能够使用此JRE来启动开发服务器:

  1. 打开「首选项 > Java > 已安装的JRE」。如果未找到您的Java 8 VM,请选择添加或搜索。
  2. 打开「首选项 > Java > 已安装的JRE > 执行环境」,选择 JavaSE-1.8,确保您的Java 8 VM 被选为默认VM。

然后,您应该能够重新启动您的应用程序,该应用程序将会使用新的JRE。

英文:

The App Engine Standard development server only supports Java 8. You can download a Java 8 JRE (or JDK) from a number of places like AdoptOpenJDK.net, Azul's Zulu, or others.

After installing the Java 8 JRE, you'll then need to configure Eclipse to be able to use this JRE for launching the development server:

  1. Open Preferences > Java > Installed JREs. Choose Add or Search if your Java 8 VM is not found.
  2. Open Preferences > Java > Installed JREs > Execution Environments and select JavaSE-1.8, and ensure that your Java 8 VM is checked as the default VM.

You should then be able to relaunch your application, which should use the new JRE.

huangapple
  • 本文由 发表于 2020年8月15日 00:23:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/63416536.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定