首页 > 解决方案 > 谷歌应用引擎项目未在调试模式下运行

问题描述

我正在 Eclipse 中使用 Google App Engine 开发一个项目。三天前,一切正常。但我不这样做,但现在我不能在本地主机上以调试模式运行项目。

当我运行它时,我收到以下错误:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.appengine.tools.development.StreamHandlerFactory (file:/Users/gallavie/Library/Application%20Support/google-cloud-tools-java/managed-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

我怎样才能解决这个问题?

感谢您在我降级到 java 12 到 java 8 时重播我收到此错误

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.appengine.tools.development.StreamHandlerFactory (file:/Users/gallavie/Library/Application%20Support/google-cloud-tools-java/managed-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
Dec 14, 2019 7:34:01 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
INFO: Overwriting system property key 'java.util.logging.config.file', value '/Users/gallavie/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/config/sdk/logging.properties' with value 'WEB-INF/logging.properties' from '/Users/gallavie/Documents/workspaces/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/Darimpo/WEB-INF/appengine-web.xml'
java.lang.NullPointerException
	at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
	at java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
	at java.base/java.util.Properties.put(Properties.java:1316)
	at java.base/java.util.Collections$CheckedMap.put(Collections.java:3638)
	at com.google.appengine.tools.development.SharedMain.setTimeZone(SharedMain.java:183)
	at com.google.appengine.tools.development.SharedMain.postServerActions(SharedMain.java:152)
	at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:398)
	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)

标签: eclipsegoogle-app-engine

解决方案


您在不支持 Java 13 的版本中使用 Google App Engine

根本原因是:

Caused by: java.lang.NoSuchMethodException: java.net.SocksSocketImpl.<init>()

这意味着java.net.SocksSocketImp存在但没有默认构造函数(没有参数的构造函数)。Google App Engine ( com.google.appengine.tools.development) 是使用默认构造函数编译的java.net.SocksSocketImp,但现在在java.net.SocksSocketImp没有默认构造函数的情况下执行。在 Java 12 及更低版本中,系统库包含java.net.SocksSocketImp默认构造函数,但在 Java 13java.net.SocksSocketImp中不再有默认构造函数


推荐阅读