Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39689

Docker-java shaded jar should not embed an old version of tiger_types (used by Stapler)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • docker-plugin
    • None

      Hey,
      Twiddling with the plugin as a dependency, I was hitting a weird NoSuchMethodError apparently in tiger_types, a low level library used by Stapler during mvn clean test on Jenkins 2.19.2.

      I was able to narrow down this error to upgrading between Jenkins 2.1 and Jenkins 2.2:

      • this version includes an update of Stapler from 1.239 to 1.243.
      • Stapler upgraded its dependency onto tiger_types from 1.3 to 2.2. In that update, there was a change on the Types.bind() method (which you see in the stack below).

      After digging into it, I finally found the docker-java-shaded java indeed included an old version of tiger_types (1.3 probably, which is why this didn't cause any issue until Jenkins 2.2 where that lib got modified/upgraded).

      Nov 12, 2016 10:30:04 AM org.eclipse.jetty.servlet.ServletHandler doHandle
      WARNING: Error for /closures/
      java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;
      	at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:155)
      	at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:142)
      	at org.kohsuke.stapler.ClassDescriptor.<init>(ClassDescriptor.java:84)
              ...
      

      The spurious tiger_types old version classes come from hk2-utils, which is coming from the jersey-client dependency:

      mvn dependency:tree -Dincludes="*:hk2-utils"
      Warning: JAVA_HOME environment variable is not set.
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Docker-java shaded jar for jenkins plugin 0.16.3-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ docker-java-shaded ---
      [INFO] com.nirima:docker-java-shaded:jar:0.16.3-SNAPSHOT
      [INFO] \- org.glassfish.jersey.core:jersey-client:jar:2.23.1:compile
      [INFO]    \- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
      [INFO]       \- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1.373 s
      [INFO] Finished at: 2016-11-12T15:13:02+01:00
      [INFO] Final Memory: 16M/298M
      

      I think at least tiger_types should be filtered out the shaded über-jar, to not conflict with the one used by Stapler.

      I am going to file a PR for that today.

      Thanks!

          [JENKINS-39689] Docker-java shaded jar should not embed an old version of tiger_types (used by Stapler)

          Baptiste Mathus created issue -
          Baptiste Mathus made changes -
          Description Original: Hey,
          Twiddling with the plugin as a dependency, I was hitting a weird {{NoSuchMethodError}} apparently in [tiger_types|https://github.com/kohsuke/tiger-types], a low level library used by Stapler during {{mvn clean test}} on Jenkins 2.19.2.

          I was able to narrow down this error to upgrading between Jenkins 2.1 and Jenkins 2.2:

          * this version includes an update of Stapler from 1.239 to 1.243.
          * Stapler upgraded its dependency onto tyger_types from 1.3 to 2.2. In that update, there was a [change on the Types.bind() method|https://github.com/kohsuke/tiger-types/commit/5ae0ef2d97e9783a839921ec7764fe7fb800013a#diff-2b87dab369e50e228861808feea56c4d] (which you see in the stack below).

          After digging into it, I finally found the {{docker-java-shaded}} java indeed included an old version of tiger_types (1.3 probably, which is why this didn't cause any issue until Jenkins 2.2 where that lib got modified/upgraded).

          {noformat}
          Nov 12, 2016 10:30:04 AM org.eclipse.jetty.servlet.ServletHandler doHandle
          WARNING: Error for /closures/
          java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:155)
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:142)
          at org.kohsuke.stapler.ClassDescriptor.<init>(ClassDescriptor.java:84)
                  ...
          {noformat}

          I think at least tiger_types should be filtered out the shaded über-jar, to not conflict with the one used by Stapler.

          I am going to file a PR for that today.

          Thanks!
          New: Hey,
          Twiddling with the plugin as a dependency, I was hitting a weird {{NoSuchMethodError}} apparently in [tiger_types|https://github.com/kohsuke/tiger-types], a low level library used by Stapler during {{mvn clean test}} on Jenkins 2.19.2.

          I was able to narrow down this error to upgrading between Jenkins 2.1 and Jenkins 2.2:

          * this version includes an update of Stapler from 1.239 to 1.243.
          * Stapler upgraded its dependency onto tyger_types from 1.3 to 2.2. In that update, there was a [change on the Types.bind() method|https://github.com/kohsuke/tiger-types/commit/5ae0ef2d97e9783a839921ec7764fe7fb800013a#diff-2b87dab369e50e228861808feea56c4d] (which you see in the stack below).

          After digging into it, I finally found the {{docker-java-shaded}} java indeed included an old version of tiger_types (1.3 probably, which is why this didn't cause any issue until Jenkins 2.2 where that lib got modified/upgraded).

          {noformat}
          Nov 12, 2016 10:30:04 AM org.eclipse.jetty.servlet.ServletHandler doHandle
          WARNING: Error for /closures/
          java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:155)
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:142)
          at org.kohsuke.stapler.ClassDescriptor.<init>(ClassDescriptor.java:84)
                  ...
          {noformat}

          The spurious {{tiger_types}} old version classes come from hk2-utils, which is coming from the jersey-client dependency:

          {noformat}
          mvn dependency:tree -Dincludes="*:hk2-utils"
          Warning: JAVA_HOME environment variable is not set.
          [INFO] Scanning for projects...
          [INFO]
          [INFO] ------------------------------------------------------------------------
          [INFO] Building Docker-java shaded jar for jenkins plugin 0.16.3-SNAPSHOT
          [INFO] ------------------------------------------------------------------------
          [INFO]
          [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ docker-java-shaded ---
          [INFO] com.nirima:docker-java-shaded:jar:0.16.3-SNAPSHOT
          [INFO] \- org.glassfish.jersey.core:jersey-client:jar:2.23.1:compile
          [INFO] \- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
          [INFO] \- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESS
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 1.373 s
          [INFO] Finished at: 2016-11-12T15:13:02+01:00
          [INFO] Final Memory: 16M/298M
          {noformat}

          I think at least {{tiger_types}} should be filtered out the shaded über-jar, to not conflict with the one used by {{Stapler}}.

          I am going to file a PR for that today.

          Thanks!
          Baptiste Mathus made changes -
          Description Original: Hey,
          Twiddling with the plugin as a dependency, I was hitting a weird {{NoSuchMethodError}} apparently in [tiger_types|https://github.com/kohsuke/tiger-types], a low level library used by Stapler during {{mvn clean test}} on Jenkins 2.19.2.

          I was able to narrow down this error to upgrading between Jenkins 2.1 and Jenkins 2.2:

          * this version includes an update of Stapler from 1.239 to 1.243.
          * Stapler upgraded its dependency onto tyger_types from 1.3 to 2.2. In that update, there was a [change on the Types.bind() method|https://github.com/kohsuke/tiger-types/commit/5ae0ef2d97e9783a839921ec7764fe7fb800013a#diff-2b87dab369e50e228861808feea56c4d] (which you see in the stack below).

          After digging into it, I finally found the {{docker-java-shaded}} java indeed included an old version of tiger_types (1.3 probably, which is why this didn't cause any issue until Jenkins 2.2 where that lib got modified/upgraded).

          {noformat}
          Nov 12, 2016 10:30:04 AM org.eclipse.jetty.servlet.ServletHandler doHandle
          WARNING: Error for /closures/
          java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:155)
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:142)
          at org.kohsuke.stapler.ClassDescriptor.<init>(ClassDescriptor.java:84)
                  ...
          {noformat}

          The spurious {{tiger_types}} old version classes come from hk2-utils, which is coming from the jersey-client dependency:

          {noformat}
          mvn dependency:tree -Dincludes="*:hk2-utils"
          Warning: JAVA_HOME environment variable is not set.
          [INFO] Scanning for projects...
          [INFO]
          [INFO] ------------------------------------------------------------------------
          [INFO] Building Docker-java shaded jar for jenkins plugin 0.16.3-SNAPSHOT
          [INFO] ------------------------------------------------------------------------
          [INFO]
          [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ docker-java-shaded ---
          [INFO] com.nirima:docker-java-shaded:jar:0.16.3-SNAPSHOT
          [INFO] \- org.glassfish.jersey.core:jersey-client:jar:2.23.1:compile
          [INFO] \- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
          [INFO] \- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESS
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 1.373 s
          [INFO] Finished at: 2016-11-12T15:13:02+01:00
          [INFO] Final Memory: 16M/298M
          {noformat}

          I think at least {{tiger_types}} should be filtered out the shaded über-jar, to not conflict with the one used by {{Stapler}}.

          I am going to file a PR for that today.

          Thanks!
          New: Hey,
          Twiddling with the plugin as a dependency, I was hitting a weird {{NoSuchMethodError}} apparently in [tiger_types|https://github.com/kohsuke/tiger-types], a low level library used by Stapler during {{mvn clean test}} on Jenkins 2.19.2.

          I was able to narrow down this error to upgrading between Jenkins 2.1 and Jenkins 2.2:

          * this version includes an update of Stapler from 1.239 to 1.243.
          * Stapler upgraded its dependency onto {{tiger_types}} from {{1.3}} to {{2.2}}. In that update, there was a [change on the Types.bind() method|https://github.com/kohsuke/tiger-types/commit/5ae0ef2d97e9783a839921ec7764fe7fb800013a#diff-2b87dab369e50e228861808feea56c4d] (which you see in the stack below).

          After digging into it, I finally found the {{docker-java-shaded}} java indeed included an old version of tiger_types (1.3 probably, which is why this didn't cause any issue until Jenkins 2.2 where that lib got modified/upgraded).

          {noformat}
          Nov 12, 2016 10:30:04 AM org.eclipse.jetty.servlet.ServletHandler doHandle
          WARNING: Error for /closures/
          java.lang.NoSuchMethodError: org.jvnet.tiger_types.Types.bind(Ljava/lang/reflect/Type;Ljava/lang/reflect/GenericDeclaration;Ljava/lang/reflect/ParameterizedType;)Ljava/lang/reflect/Type;
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:155)
          at org.kohsuke.stapler.ClassDescriptor.findMethods(ClassDescriptor.java:142)
          at org.kohsuke.stapler.ClassDescriptor.<init>(ClassDescriptor.java:84)
                  ...
          {noformat}

          The spurious {{tiger_types}} old version classes come from hk2-utils, which is coming from the jersey-client dependency:

          {noformat}
          mvn dependency:tree -Dincludes="*:hk2-utils"
          Warning: JAVA_HOME environment variable is not set.
          [INFO] Scanning for projects...
          [INFO]
          [INFO] ------------------------------------------------------------------------
          [INFO] Building Docker-java shaded jar for jenkins plugin 0.16.3-SNAPSHOT
          [INFO] ------------------------------------------------------------------------
          [INFO]
          [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ docker-java-shaded ---
          [INFO] com.nirima:docker-java-shaded:jar:0.16.3-SNAPSHOT
          [INFO] \- org.glassfish.jersey.core:jersey-client:jar:2.23.1:compile
          [INFO] \- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile
          [INFO] \- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESS
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 1.373 s
          [INFO] Finished at: 2016-11-12T15:13:02+01:00
          [INFO] Final Memory: 16M/298M
          {noformat}

          I think at least {{tiger_types}} should be filtered out the shaded über-jar, to not conflict with the one used by {{Stapler}}.

          I am going to file a PR for that today.

          Thanks!

          Code changed in jenkins
          User: Baptiste Mathus
          Path:
          docker-java-shaded/pom.xml
          http://jenkins-ci.org/commit/docker-plugin/87857fe4ed673df3adb90cd9a75ed03c7469dbd5
          Log:
          [FIX JENKINS-39689] dont embed an old version of tiger_types

          Which in turn is used by Stapler.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Baptiste Mathus Path: docker-java-shaded/pom.xml http://jenkins-ci.org/commit/docker-plugin/87857fe4ed673df3adb90cd9a75ed03c7469dbd5 Log: [FIX JENKINS-39689] dont embed an old version of tiger_types Which in turn is used by Stapler.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Code changed in jenkins
          User: Abhilash Jindal
          Path:
          pom.xml
          http://jenkins-ci.org/commit/eagle-tester-plugin/92da4a4c9133bef5d4c4c220c51110502db1a54c
          Log:
          update jersey version

          `mvn clean install` succeeds now. Had to bring down Jenkins version to 2.73.3.
          There is a failure in InjectedTest otherwise due to some conflict in
          jersey-client and stapler.

          https://issues.jenkins-ci.org/browse/JENKINS-39689

          Also removed junit, already in org.jenkins-ci.plugins:plugin:2.33.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Abhilash Jindal Path: pom.xml http://jenkins-ci.org/commit/eagle-tester-plugin/92da4a4c9133bef5d4c4c220c51110502db1a54c Log: update jersey version `mvn clean install` succeeds now. Had to bring down Jenkins version to 2.73.3. There is a failure in InjectedTest otherwise due to some conflict in jersey-client and stapler. https://issues.jenkins-ci.org/browse/JENKINS-39689 Also removed junit, already in org.jenkins-ci.plugins:plugin:2.33.
          Baptiste Mathus made changes -
          Link New: This issue is related to JENKINS-48894 [ JENKINS-48894 ]

            magnayn magnayn
            batmat Baptiste Mathus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: