jreLeakPrevention.gcDaemonFail 运行 GWT 应用程序出错
jreLeakPrevention.gcDaemonFail Error while running GWT application
Getting error while running a simple GWT application. when I ran by
ant through command line it worked fine but after importing in
IntelliJ I am getting this error. Don't know why I am getting this
error:
The code server is ready at http://127.0.0.1:9876/
Code server started in 9.247 s ms
2019-11-09 01:07:02.250:INFO:oejs.ServerConnector:main: Started ServerConnector@1d54b16e{HTTP/1.1}{127.0.0.1:9876}
2019-11-09 01:07:02.250:INFO:oejs.Server:main: Started @10313ms
**[ERROR] jreLeakPrevention.gcDaemonFail
java.lang.ClassNotFoundException: sun.misc.GC**
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.google.gwt.dev.shell.jetty.JettyLauncher.jreLeakPrevention(JettyLauncher.java:899)
at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:722)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
at com.google.gwt.dev.DevMode.main(DevMode.java:432)
2019-11-09 01:07:02.307:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT
Starting Jetty on port 8888
[WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@e59f292{/,file:/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www/,STARTING}{/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www}
java.lang.RuntimeException: Error scanning file GreetingServiceImpl.class
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:824)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
at org.eclipse.jetty.annotations.AnnotationConfiguration.run(AnnotationConfiguration.java:548)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:555)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:973)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702)
... 10 more
2019-11-09 01:07:05.521:INFO:oejs.ServerConnector:main: Started ServerConnector@539f3a98{HTTP/1.1}{127.0.0.1:8888}
2019-11-09 01:07:05.528:INFO:oejs.Server:main: Started @13591ms
Dev Mode initialized. Startup URL:
http://127.0.0.1:8888/MyWebApp.html
[ERROR] 503 - GET /MyWebApp.html (127.0.0.1) 301 bytes
Request headers
Host: 127.0.0.1:8888
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87
Safari/537.36
Sec-Fetch-User: ?1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
If-Modified-Since: Fri, 08 Nov 2019 16:26:04 GMT
Response headers
Date: Fri, 08 Nov 2019 19:37:05 GMT
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 301
[ERROR] 503 - GET /MyWebApp.html (127.0.0.1) 301 bytes
Request headers
Host: 127.0.0.1:8888
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87
Safari/537.36
Sec-Fetch-User: ?1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Response headers
Date: Fri, 08 Nov 2019 19:39:53 GMT
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 301
GET /clean/mywebapp
Cleaning disk caches.
Cleaned in 13ms.
[ERROR] 503 - GET /MyWebApp.html (127.0.0.1) 301 bytes
Request headers
Host: 127.0.0.1:8888
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87
Safari/537.36
Sec-Fetch-User: ?1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Response headers
Date: Fri, 08 Nov 2019 19:52:14 GMT
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 301
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)
这里有两个错误,它们是无关的。
java.lang.ClassNotFoundException: sun.misc.GC**
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.google.gwt.dev.shell.jetty.JettyLauncher.jreLeakPrevention(JettyLauncher.java:899)
忽略这一点是安全的。对此进行检查是为了防止发生这种情况——您正在使用的 JRE 实现删除了此功能。检查此版本 GWT 中的 JettyLauncher.java,您会发现以下代码:
https://github.com/gwtproject/gwt/blob/a90832fec9a56f4cb83ed009c7048e0a8d196fe8/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java#L898-L915
try {
Class<?> clazz = Class.forName("sun.misc.GC");
Method method = clazz.getDeclaredMethod("requestLatency",
new Class[]{long.class});
method.invoke(null, Long.valueOf(3600000));
} catch (ClassNotFoundException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (SecurityException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (NoSuchMethodException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (IllegalArgumentException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (IllegalAccessException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (InvocationTargetException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
}
这些 catch 语句让我们记录错误,然后继续。
第二个例外:
[WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@e59f292{/,file:/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www/,STARTING}{/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www}
java.lang.RuntimeException: Error scanning file GreetingServiceImpl.class
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:824)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
at org.eclipse.jetty.annotations.AnnotationConfiguration.run(AnnotationConfiguration.java:548)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:555)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:973)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702)
... 10 more
这是一个单独的错误,与上述错误或您 post 的标题无关。我不太确定这里发生了什么——最好的猜测是,你有一些字节码在扫描时 asm 无法读取。也许清理您的项目并重试?
你可能运气更好 post 解决这个错误,因为另一个错误只是转移注意力。
Getting error while running a simple GWT application. when I ran by ant through command line it worked fine but after importing in IntelliJ I am getting this error. Don't know why I am getting this error:
The code server is ready at http://127.0.0.1:9876/ Code server started in 9.247 s ms 2019-11-09 01:07:02.250:INFO:oejs.ServerConnector:main: Started ServerConnector@1d54b16e{HTTP/1.1}{127.0.0.1:9876} 2019-11-09 01:07:02.250:INFO:oejs.Server:main: Started @10313ms **[ERROR] jreLeakPrevention.gcDaemonFail java.lang.ClassNotFoundException: sun.misc.GC** at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at com.google.gwt.dev.shell.jetty.JettyLauncher.jreLeakPrevention(JettyLauncher.java:899) at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:722) at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706) at com.google.gwt.dev.DevMode.main(DevMode.java:432) 2019-11-09 01:07:02.307:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT Starting Jetty on port 8888 [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@e59f292{/,file:/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www/,STARTING}{/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www} java.lang.RuntimeException: Error scanning file GreetingServiceImpl.class at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:824) at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163) at org.eclipse.jetty.annotations.AnnotationConfiguration.run(AnnotationConfiguration.java:548) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:555) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.<init>(Unknown Source) at org.objectweb.asm.ClassReader.<init>(Unknown Source) at org.objectweb.asm.ClassReader.<init>(Unknown Source) at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:973) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702) ... 10 more 2019-11-09 01:07:05.521:INFO:oejs.ServerConnector:main: Started ServerConnector@539f3a98{HTTP/1.1}{127.0.0.1:8888} 2019-11-09 01:07:05.528:INFO:oejs.Server:main: Started @13591ms Dev Mode initialized. Startup URL: http://127.0.0.1:8888/MyWebApp.html [ERROR] 503 - GET /MyWebApp.html (127.0.0.1) 301 bytes Request headers Host: 127.0.0.1:8888 Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87
Safari/537.36 Sec-Fetch-User: ?1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3 Sec-Fetch-Site: none Sec-Fetch-Mode: navigate Accept-Encoding: gzip, deflate, br Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 If-Modified-Since: Fri, 08 Nov 2019 16:26:04 GMT Response headers Date: Fri, 08 Nov 2019 19:37:05 GMT Cache-Control: must-revalidate,no-cache,no-store Content-Type: text/html; charset=ISO-8859-1 Content-Length: 301 [ERROR] 503 - GET /MyWebApp.html (127.0.0.1) 301 bytes Request headers Host: 127.0.0.1:8888 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36 Sec-Fetch-User: ?1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3 Sec-Fetch-Site: none Sec-Fetch-Mode: navigate Accept-Encoding: gzip, deflate, br Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 Response headers Date: Fri, 08 Nov 2019 19:39:53 GMT Cache-Control: must-revalidate,no-cache,no-store Content-Type: text/html; charset=ISO-8859-1 Content-Length: 301 GET /clean/mywebapp Cleaning disk caches. Cleaned in 13ms. [ERROR] 503 - GET /MyWebApp.html (127.0.0.1) 301 bytes Request headers Host: 127.0.0.1:8888 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36 Sec-Fetch-User: ?1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3 Sec-Fetch-Site: none Sec-Fetch-Mode: navigate Accept-Encoding: gzip, deflate, br Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 Response headers Date: Fri, 08 Nov 2019 19:52:14 GMT Cache-Control: must-revalidate,no-cache,no-store Content-Type: text/html; charset=ISO-8859-1 Content-Length: 301
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)
这里有两个错误,它们是无关的。
java.lang.ClassNotFoundException: sun.misc.GC**
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.google.gwt.dev.shell.jetty.JettyLauncher.jreLeakPrevention(JettyLauncher.java:899)
忽略这一点是安全的。对此进行检查是为了防止发生这种情况——您正在使用的 JRE 实现删除了此功能。检查此版本 GWT 中的 JettyLauncher.java,您会发现以下代码: https://github.com/gwtproject/gwt/blob/a90832fec9a56f4cb83ed009c7048e0a8d196fe8/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java#L898-L915
try {
Class<?> clazz = Class.forName("sun.misc.GC");
Method method = clazz.getDeclaredMethod("requestLatency",
new Class[]{long.class});
method.invoke(null, Long.valueOf(3600000));
} catch (ClassNotFoundException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (SecurityException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (NoSuchMethodException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (IllegalArgumentException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (IllegalAccessException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
} catch (InvocationTargetException e) {
logger.log(TreeLogger.ERROR, "jreLeakPrevention.gcDaemonFail", e);
}
这些 catch 语句让我们记录错误,然后继续。
第二个例外:
[WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@e59f292{/,file:/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www/,STARTING}{/Users/pchenchala/Library/Caches/IntelliJIdea2019.2/gwt/mywebapp.4e8f7f71/MyWebApp.c24f5151/run/www}
java.lang.RuntimeException: Error scanning file GreetingServiceImpl.class
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:688)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:824)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
at org.eclipse.jetty.annotations.AnnotationConfiguration.run(AnnotationConfiguration.java:548)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:555)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:973)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702)
... 10 more
这是一个单独的错误,与上述错误或您 post 的标题无关。我不太确定这里发生了什么——最好的猜测是,你有一些字节码在扫描时 asm 无法读取。也许清理您的项目并重试?
你可能运气更好 post 解决这个错误,因为另一个错误只是转移注意力。