在GAE上运行时的Jersey java.lang.NoSuchMethodError异常

时间:2019-02-07 13:23:42

标签: java google-app-engine jersey-2.0

当尝试在具有最新版本的GAE上运行时,我遇到以下异常。任何想法将不胜感激! 在将我的应用程序移至Java 8之后出现了问题-完美运行了三年,没有任何问题!它在本地运行,但不在应用程序引擎上运行。

[INFO] java.lang.NoSuchMethodError: org.glassfish.jersey.server.ApplicationHandler.<init>(Ljavax/ws/rs/core/Application;Lorg/glassfish/hk2/utilities/Binder;Lorg/glassfish/hk2/api/ServiceLocator;)V
[INFO]  at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:339)
[INFO]  at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)

这是我的Maven文件:

      <!-- Compile/runtime dependencies -->
    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-api-1.0-sdk</artifactId>
        <version>${appengine.version}</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.objectify</groupId>
        <artifactId>objectify</artifactId>
        <version>4.0.1</version>
    </dependency>
    <dependency>
         <groupId>com.google.appengine</groupId>
         <artifactId>appengine-api-labs</artifactId>
         <version>1.9.71</version>
         <!-- <scope>test</scope> -->
    </dependency>

    <dependency>
          <groupId>javax.persistence</groupId>
          <artifactId>persistence-api</artifactId>  
          <version>1.0</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.3</version>
    </dependency>

    <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" -->
        <artifactId>jersey-container-servlet</artifactId>
        <version>2.2</version>
    </dependency>

    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <scope>runtime</scope>
        <version>2.2</version>
    </dependency>

    <dependency>
          <groupId>com.owlike</groupId>
          <artifactId>genson</artifactId>
          <version>1.4</version>
    </dependency>

mvn依赖项:输出

  org.eclipse.jetty:apache-jsp:jar:9.4.8.v20171121:compile
org.mortbay.jasper:apache-jsp:jar:8.5.23:compile
  org.eclipse.jdt:ecj:jar:3.12.3:compile
org.eclipse.jetty:jetty-annotations:jar:9.4.8.v20171121:compile
   org.eclipse.jetty:jetty-webapp:jar:9.4.8.v20171121:compile
           org.eclipse.jetty:jetty-server:jar:9.4.8.v20171121:compile
   javax.annotation:javax.annotation-api:jar:1.2:compile
   org.ow2.asm:asm:jar:6.0:compile
      org.ow2.asm:asm-tree:jar:6.0:compile
com.google.guava:guava:jar:14.0.1:compile
com.google.appengine:appengine-api-labs:jar:1.9.30:compile
org.glassfish.jersey.containers:jersey-container-servlet:jar:2.2:compile
org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.2:compile
org.glassfish.jersey.core:jersey-common:jar:2.2:compile
  org.glassfish.hk2:hk2-api:jar:2.2.0-b14:compile
    org.glassfish.hk2:hk2-utils:jar:2.2.0-b14:compile
    org.glassfish.hk2.external:asm-all-repackaged:jar:2.2.0-b14:compile
  org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
org.glassfish.jersey.core:jersey-server:jar:2.2:compile
org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.2:runtime
org.codehaus.jackson:jackson-core-asl:jar:1.9.11:runtime

0 个答案:

没有答案