运行简单的GWT应用程序时出错。当我跑过去时通过命令行蚂蚁工作正常,但导入后IntelliJ我收到此错误。不知道为什么我要这个错误:
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$1.run(AnnotationConfiguration.java:548) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.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安全提取用户:?1接受:text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp,image / apng,/; q = 0.8,application / signed-exchange; v = b3安全提取站点:无安全提取模式:导航接受编码:gzip,deflate,br接受语言:en-GB,en-US; q = 0.9,en; q = 0.8If-Modified-Since:Fri,08 Nov 2019 16:26:04 GMT响应头日期:2019年11月8日星期五19:37:05 GMT缓存控制:必须重新验证,无缓存,无存储内容类型:text / html;字符集= ISO-8859-1内容长度:301[错误] 503-GET /MyWebApp.html(127.0.0.1)301字节请求头主持人:127.0.0.1:8888连接:保持活动状态快取控制:max-age = 0不安全升级请求:1用户代理:Mozilla / 5.0(Macintosh; Intel Mac OS X 10_14_3)AppleWebKit / 537.36(KHTML,如Gecko)Chrome / 78.0.3904.87的Safari / 537.36安全提取用户:?1接受:text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp,image / apng,/; q = 0.8,application / signed-exchange; v = b3安全提取站点:无安全提取模式:导航接受编码:gzip,deflate,br接受语言:en-GB,en-US; q = 0.9,en; q = 0.8响应头日期:2019年11月8日星期五19:39:53 GMT缓存控制:必须重新验证,无缓存,无存储内容类型:text / html;字符集= ISO-8859-1内容长度:301GET / clean / mywebapp清理磁盘缓存。在13ms内清除。[错误] 503-GET /MyWebApp.html(127.0.0.1)301字节请求头主持人:127.0.0.1:8888连接:保持活动状态快取控制:max-age = 0不安全升级请求:1用户代理:Mozilla / 5.0(Macintosh; Intel Mac OS X 10_14_3)AppleWebKit / 537.36(KHTML,如Gecko)Chrome / 78.0.3904.87的Safari / 537.36安全提取用户:?1接受:text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp,image / apng,/; q = 0.8,application / signed-exchange; v = b3安全提取站点:无安全提取模式:导航接受编码:gzip,deflate,br接受语言:en-GB,en-US; q = 0.9,en; q = 0.8响应头日期:2019年11月8日星期五19:52:14 GMT缓存控制:必须重新验证,无缓存,无存储内容类型:text / html;字符集= ISO-8859-1内容长度: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$1.run(AnnotationConfiguration.java:548)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.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
这是一个单独的错误,与以上内容或您的帖子标题无关。我不太确定这里发生了什么-最好的猜测是,您有一些字节码,扫描时asm无法读取。也许清理您的项目然后重试?
您可能最好只发布有关此错误的信息,因为另一个错误只是一个红色的鲱鱼。