NoSuchMethodError: org.eclipse.jetty.websocket.server.WebSocketServerFactory.(Ljavax/servlet/ServletContext;)V

后端 未结 2 472

I have this exception when launching my application via eclipse plugin: \"Run as\" > \"GWT Development Mode with jetty\"

Environment:
- GWT SDK

相关标签:
2条回答
  • 2021-01-19 10:56

    You have a mixture of Jetty versions on the class path: 9.4.2.v20170220 and 9.2.14.v20151106. The former is what Spring Boot 1.5.2 uses by default. I would guess that latter is from the import of com.google.gwt:gwt.

    You could override the jetty.version property that Spring Boot uses to set its value to 9.2.14.v20151106, thereby using 9.2.14 everywhere. Alternatively, you could declare your own dependency management for the modules that are currently using 9.2.14 to upgrade them to 9.4.2.

    0 讨论(0)
  • 2021-01-19 11:00

    If I upgrade spring-boot version to 1.5.3.RELEASE, it seems to be ok: no such exception appears.

    <parent>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-parent</artifactId>
     <version>1.5.3.RELEASE</version>
    </parent>
    

    Nevertheless, an another exception occured:

    ServiceConfigurationError: org.apache.juli.logging.Log: Provider org.eclipse.jetty.apache.jsp.JuliLog not a subtype
    

    To fix it, I have excluded jetty apache-jsp dependency from gwt-dev dependency

    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
            <artifactId>apache-jsp</artifactId>
            <groupId>org.eclipse.jetty</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题