GWT 应用程序编译问题 - 错误,状态 503

Posted

技术标签:

【中文标题】GWT 应用程序编译问题 - 错误,状态 503【英文标题】:Problem with GWT application compilation - Error, status 503 【发布时间】:2021-03-24 05:20:00 【问题描述】:

我是 GWT 的新手。 我已经生成了第一个有效的应用程序,但我卡在了另一个应用程序上——我无法运行。 我的浏览器状态为 503

我是不是忘记了什么?

项目设置的模块部分中的所有内容都与其他应用程序中的相同, pom.xml 都是一样的 也许我应该对 web.xml 进行一些更改? 寻找一些类似问题的解决方案,我已删除 在 web.xml 文件中这行:

<servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>eu.mrndesign.matned.server.GreetingServiceImpl</servlet-class>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/arkanoidgame/greet</url-pattern>
  </servlet-mapping>

这是一个堆栈跟踪:

 > Starting Jetty on port 8888
   [WARN] Failed startup of context c.g.g.d.s.j.WebAppContextWithReload@3027a1f1/,file:/C:/Users/matni/.IntelliJIdea2019.3/system/gwt/arkanoidgame.b9d5fc4/ArkanoidGame.513aa147/run/www/,STARTINGC:\Users\matni\.IntelliJIdea2019.3\system\gwt\arkanoidgame.b9d5fc4\ArkanoidGame.513aa147\run\www
MultiException[java.lang.RuntimeException: Error scanning file ArkanoidGame$1.class, java.lang.RuntimeException: Error scanning file ArkanoidGame$1MyHandler$1.class, java.lang.RuntimeException: Error scanning file ArkanoidGame$1MyHandler.class, java.lang.RuntimeException: Error scanning file ArkanoidGame.class]
    at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:536)
    at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:447)
    at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:479)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1337)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.handler.RequestLogHandler.doStart(RequestLogHandler.java:140)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:760)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:898)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:705)
    at com.google.gwt.dev.DevMode.main(DevMode.java:432)
Caused by: MultiException[java.lang.RuntimeException: Error scanning file ArkanoidGame$1.class, java.lang.RuntimeException: Error scanning file ArkanoidGame$1MyHandler$1.class, java.lang.RuntimeException: Error scanning file ArkanoidGame$1MyHandler.class, java.lang.RuntimeException: Error scanning file ArkanoidGame.class]
    at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:681)
    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)
    Suppressed: java.lang.RuntimeException: Error scanning file ArkanoidGame$1MyHandler$1.class
        at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708)
        ... 10 more
    Caused by: java.lang.UnsupportedOperationException: This feature requires ASM7
        at org.objectweb.asm.ClassVisitor.visitNestHost(ClassVisitor.java:150)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:550)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:400)
        at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:974)
        at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702)
        ... 10 more
    Suppressed: java.lang.RuntimeException: Error scanning file ArkanoidGame$1MyHandler.class
        at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708)
        ... 10 more
    Caused by: java.lang.UnsupportedOperationException: This feature requires ASM7
        at org.objectweb.asm.ClassVisitor.visitNestHost(ClassVisitor.java:150)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:550)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:400)
        at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:974)
        at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702)
        ... 10 more
    Suppressed: java.lang.RuntimeException: Error scanning file ArkanoidGame.class
        at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708)
        ... 10 more
    Caused by: java.lang.UnsupportedOperationException: This feature requires ASM7
        at org.objectweb.asm.ClassVisitor.visitNestMember(ClassVisitor.java:236)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:660)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:400)
        at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:974)
        at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702)
        ... 10 more
Caused by: java.lang.RuntimeException: Error scanning file ArkanoidGame$1.class
    at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:708)
    ... 10 more
Caused by: java.lang.UnsupportedOperationException: This feature requires ASM7
    at org.objectweb.asm.ClassVisitor.visitNestHost(ClassVisitor.java:150)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:550)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:400)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:974)
    at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:702)
    ... 10 more
2020-12-13 10:41:02.813:INFO:oejs.ServerConnector:main: Started ServerConnector@2f067ac5HTTP/1.1127.0.0.1:8888
2020-12-13 10:41:02.815:INFO:oejs.Server:main: Started @18361ms
Dev Mode initialized. Startup URL: 
http://127.0.0.1:8888/ArkanoidGame.html
[ERROR] 503 - GET /ArkanoidGame.html (127.0.0.1) 305 bytes
   Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      DNT: 1
      Upgrade-Insecure-Requests: 1
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
      Sec-Fetch-Site: none
      Sec-Fetch-Mode: navigate
      Sec-Fetch-User: ?1
      Sec-Fetch-Dest: document
      Accept-Encoding: gzip, deflate, br
      Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7
   Response headers
      Date: Sun, 13 Dec 2020 09:41:03 GMT
      Cache-Control: must-revalidate,no-cache,no-store
      Content-Type: text/html; charset=ISO-8859-1
      Content-Length: 305

   

【问题讨论】:

看起来像是 Java 11 的问题。尝试使用 Thomas Broyer 的 gwt-maven-architype (github.com/tbroyer/gwt-maven-archetypes)、github.com/NaluKit/gwt-maven-springboot-archetype,或从此处生成 Nalu GWT 项目:mvp4g.org/boot-starter-nalu/BootStarterNalu.html @ElHoss 所以他正在使用 Mojo gwt-maven-plugin 并且不支持 Java 11? 不要认为插件是问题所在。我认为它是 Jetty 版本。 检查这些线程:github.com/devsoap/ds-gradle-vaadin/issues/172 github.com/eclipse/jetty.project/issues/2941 【参考方案1】:

将 ASM 或 Jetty 版本升级到支持 Java 11+ 版本的版本。见https://github.com/eclipse/jetty.project/issues/2941

【讨论】:

好吧,我想这就是问题所在,我已经降级了 jdk 并且它有效。当我升级 Jetty 时,我可以使用 jdk11。非常感谢。

以上是关于GWT 应用程序编译问题 - 错误,状态 503的主要内容,如果未能解决你的问题,请参考以下文章

com.google.gwt.dev.jjs.InternalCompilerException:访问期间出现意外错误

gwt编译错误

检查服务器状态时出现 Elasticsearch 503 错误

GWT + MVP4g+Ivy:编译错误

Docker - 来自守护程序的错误响应:收到意外的 HTTP 状态:503 服务不可用

网页503错误