jersey
  1. jersey
  2. JERSEY-2394

NoSuchMethodError -- jersey.internal.util.collection.Value.lazy

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.5.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:

      Linux 2.6.32-358.18.1.el6.x86_64 GNU/Linux

      Description

      java.lang.NoSuchMethodError: org.glassfish.jersey.internal.util.collection.Values.lazy(Lorg/glassfish/jersey/internal/util/collection/Value;)Lorg/glassfish/jersey/internal/util/collection/Value;

      when attempting to go to api-base/api-docs/resourceName

      (Stack trace below)

      [root@machine ~]$ cd /opt/tomcat/webapps/company/WEB-INF/lib/
      [root@machine lib]# ls -al | egrep '(jersey|json|jax)'
      rw-rr- 1 root root 94774 Feb 10 12:02 cxf-rt-databinding-jaxb-2.3.2.jar
      rw-rr- 1 root root 341446 Feb 10 12:02 cxf-rt-frontend-jaxws-2.3.2.jar
      rw-rr- 1 root root 20020 Feb 10 12:02 jackson-jaxrs-base-2.2.3.jar
      rw-rr- 1 root root 15243 Feb 10 12:02 jackson-jaxrs-json-provider-2.2.3.jar
      rw-rr- 1 root root 25985 Feb 10 12:02 jackson-module-jaxb-annotations-2.2.3.jar
      rw-rr- 1 root root 50034 Feb 10 12:02 jackson-module-jsonSchema-2.1.0.jar
      rw-rr- 1 root root 79309 Feb 10 12:02 javax.json-1.0.2.jar
      rw-rr- 1 root root 19754 Feb 10 12:02 javax.json-api-1.0.jar
      rw-rr- 1 root root 876610 Feb 10 12:02 jaxb-impl-2.1.13.jar
      rw-rr- 1 root root 226915 Feb 10 12:02 jaxen-1.1.1.jar
      rw-rr- 1 root root 159742 Feb 10 14:02 jersey-client-2.5.1.jar
      rw-rr- 1 root root 700399 Feb 10 14:02 jersey-common-2.5.1.jar
      rw-rr- 1 root root 15684 Feb 10 14:02 jersey-container-servlet-2.5.1.jar
      rw-rr- 1 root root 52593 Feb 10 12:02 jersey-container-servlet-core-2.1.jar
      rw-rr- 1 root root 6412 Feb 10 14:02 jersey-media-json-processing-2.5.1.jar
      rw-rr- 1 root root 63067 Feb 10 12:02 jersey-media-multipart-2.1.jar
      rw-rr- 1 root root 828016 Feb 10 14:02 jersey-server-2.5.1.jar
      rw-rr- 1 root root 86540 Feb 10 12:02 json4s-ast_2.10-3.2.4.jar
      rw-rr- 1 root root 568890 Feb 10 12:02 json4s-core_2.10-3.2.4.jar
      rw-rr- 1 root root 74565 Feb 10 12:02 json4s-ext_2.10-3.2.4.jar
      rw-rr- 1 root root 39952 Feb 10 12:02 json4s-jackson_2.10-3.2.4.jar
      rw-rr- 1 root root 68734 Feb 10 12:02 json4s-native_2.10-3.2.4.jar
      rw-rr- 1 root root 7814 Feb 10 12:02 jsonp-jaxrs-1.0.jar
      rw-rr- 1 root root 121047 Feb 10 12:02 swagger-jaxrs_2.10-1.3.2.jar
      rw-rr- 1 root root 45719 Feb 10 12:02 swagger-jersey2-jaxrs_2.10-1.3.2.jar

      • - - - -

      Stack trace:

      Feb 10, 2014 17:17:53 ERROR [TP-Processor5] [Catalina].[localhost].[/company].[Jersey REST Service] - Servlet.service() for servlet Jersey REST Service threw exception
      java.lang.NoSuchMethodError: org.glassfish.jersey.internal.util.collection.Values.lazy(Lorg/glassfish/jersey/internal/util/collection/Value;)Lorg/glassfish/jersey/internal/util/collection/Value;
      at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:372)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:218)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.company.videoapp.server.springframework.SessionFilter.doFilter(SessionFilter.java:44)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.company.videoapp.server.springframework.loader.ContextLoaderHttpInterceptor$LoaderState.filter(ContextLoaderHttpInterceptor.java:75)
      at com.company.videoapp.server.springframework.loader.ContextLoaderHttpInterceptor$StartedState.filter(ContextLoaderHttpInterceptor.java:120)
      at com.company.videoapp.server.springframework.loader.ContextLoaderHttpInterceptor.doFilter(ContextLoaderHttpInterceptor.java:62)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:311)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:662)
      Feb 10, 2014 17:17:53 ERROR [TP-Processor5] [Catalina].[localhost].[/company].[Jersey REST Service] - Servlet.service() for servlet Jersey REST Service threw exception
      java.lang.NoSuchMethodError: org.glassfish.jersey.internal.util.collection.Values.lazy(Lorg/glassfish/jersey/internal/util/collection/Value;)Lorg/glassfish/jersey/internal/util/collection/Value;
      at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:372)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335)
      at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:218)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.company.videoapp.server.springframework.SessionFilter.doFilter(SessionFilter.java:44)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at com.company.videoapp.server.springframework.loader.ContextLoaderHttpInterceptor$LoaderState.filter(ContextLoaderHttpInterceptor.java:75)
      at com.company.videoapp.server.springframework.loader.ContextLoaderHttpInterceptor$StartedState.filter(ContextLoaderHttpInterceptor.java:120)
      at com.company.videoapp.server.springframework.loader.ContextLoaderHttpInterceptor.doFilter(ContextLoaderHttpInterceptor.java:62)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:311)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:662)

        Activity

        Hide
        rG. added a comment - - edited

        Edit: This was attempting to go to resourceName.html (resourceName works and returns the resource definition as JSON.)

        I can't find where to edit this issue... here's some additional info –

        [root@machine ~]# /opt/tomcat/bin/version.sh
        Using CATALINA_BASE: /opt/tomcat
        Using CATALINA_HOME: /opt/tomcat
        Using CATALINA_TMPDIR: /opt/tomcat/temp
        Using JRE_HOME: /usr/java/latest
        Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar
        Server version: Apache Tomcat/6.0.37
        Server built: Apr 29 2013 11:34:47
        Server number: 6.0.0.37
        OS Name: Linux
        OS Version: 2.6.32-358.18.1.el6.x86_64
        Architecture: amd64
        JVM Version: 1.6.0_32-b05
        JVM Vendor: Sun Microsystems Inc.

        • - - - - - - - - -

        [root@machine ~]# ps -ef | grep java
        [...]
        root 29150 1 1 14:13 ? 00:03:03 /usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -XX:+UseParallelGC -XX:MaxPermSize=256m -Djava.awt.headless=true -Dsun.net.client.defaultConnectTimeout=120000 -Dsun.net.client.defaultReadTimeout=120000 -Dsun.net.inetaddr.ttl=120 -Dsun.net.inetaddr.negative.ttl=60 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/company/java_pid.hprof -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -Xmx768m -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start

        Show
        rG. added a comment - - edited Edit: This was attempting to go to resourceName.html (resourceName works and returns the resource definition as JSON.) I can't find where to edit this issue... here's some additional info – [root@machine ~] # /opt/tomcat/bin/version.sh Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/java/latest Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar Server version: Apache Tomcat/6.0.37 Server built: Apr 29 2013 11:34:47 Server number: 6.0.0.37 OS Name: Linux OS Version: 2.6.32-358.18.1.el6.x86_64 Architecture: amd64 JVM Version: 1.6.0_32-b05 JVM Vendor: Sun Microsystems Inc. - - - - - - - - - [root@machine ~] # ps -ef | grep java [...] root 29150 1 1 14:13 ? 00:03:03 /usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -XX:+UseParallelGC -XX:MaxPermSize=256m -Djava.awt.headless=true -Dsun.net.client.defaultConnectTimeout=120000 -Dsun.net.client.defaultReadTimeout=120000 -Dsun.net.inetaddr.ttl=120 -Dsun.net.inetaddr.negative.ttl=60 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/company/java_pid.hprof -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -Xmx768m -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start
        Hide
        rG. added a comment -

        @Jersey developers

        Please refer to http://stackoverflow.com/questions/21742665/nosuchmethoderror-on-values-lazy-jersey-2-5-1/21743658

        There seems to be a few big regressions in 2.5.1 related to resource annotations on interfaces.

        Thanks,

        – Ryan

        Show
        rG. added a comment - @Jersey developers Please refer to http://stackoverflow.com/questions/21742665/nosuchmethoderror-on-values-lazy-jersey-2-5-1/21743658 There seems to be a few big regressions in 2.5.1 related to resource annotations on interfaces. Thanks, – Ryan
        Hide
        Michal Gajdos added a comment -

        You have 2 Jersey jars with different version than 2.5.1 in your project - jersey-media-multipart-2.1.jar and jersey-container-servlet-core-2.1.jar. The latter one causes the problem you have. Lines from the stacktrace correspond with the idea that 2.1 version of jersey servlet core is used instead of 2.5.1 (see WebComponent [1] from 2.1). The solution would be to remove the old jars.

        [1] https://github.com/jersey/jersey/blob/2.1/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/WebComponent.java#L346

        Show
        Michal Gajdos added a comment - You have 2 Jersey jars with different version than 2.5.1 in your project - jersey-media-multipart-2.1.jar and jersey-container-servlet-core-2.1.jar. The latter one causes the problem you have. Lines from the stacktrace correspond with the idea that 2.1 version of jersey servlet core is used instead of 2.5.1 (see WebComponent [1] from 2.1). The solution would be to remove the old jars. [1] https://github.com/jersey/jersey/blob/2.1/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/WebComponent.java#L346
        Hide
        rG. added a comment -

        Hey Michael,

        Responded to the SO post – Swagger was messing things up.

        However, the other issues with the interfaces seem to be legit regressions. Perhaps this has something to do with 2175

        Regards,

        – Ryan

        Show
        rG. added a comment - Hey Michael, Responded to the SO post – Swagger was messing things up. However, the other issues with the interfaces seem to be legit regressions. Perhaps this has something to do with 2175 Regards, – Ryan
        Hide
        Michal Gajdos added a comment -

        The core issue has been caused by having 2 different Jersey 2.x versions on classpath. Can you please file another issue mentioning inheritance progress (to avoid confusion). Thanks.

        Show
        Michal Gajdos added a comment - The core issue has been caused by having 2 different Jersey 2.x versions on classpath. Can you please file another issue mentioning inheritance progress (to avoid confusion). Thanks.
        Hide
        rG. added a comment -

        Created – 2418

        Reproduced just now with 2.6-SNAPSHOT. Thanks.

        Show
        rG. added a comment - Created – 2418 Reproduced just now with 2.6-SNAPSHOT. Thanks.

          People

          • Assignee:
            Unassigned
            Reporter:
            rG.
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: