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

17 views
Skip to first unread message

batmat@batmat.net (JIRA)

unread,
Nov 12, 2016, 8:59:02 AM11/12/16
to jenkinsc...@googlegroups.com
Baptiste Mathus created an issue
 
Jenkins / Bug JENKINS-39689
Docker-java shaded jar should not embed an old version of tiger_types (used by Stapler)
Issue Type: Bug Bug
Assignee: magnayn
Components: docker-plugin
Created: 2016/Nov/12 1:58 PM
Priority: Major Major
Reporter: Baptiste Mathus

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 tyger_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)
        ...

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!

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

batmat@batmat.net (JIRA)

unread,
Nov 12, 2016, 9:16:01 AM11/12/16
to jenkinsc...@googlegroups.com
Baptiste Mathus updated an issue
Change By: Baptiste Mathus
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!

batmat@batmat.net (JIRA)

unread,
Nov 12, 2016, 4:12:02 PM11/12/16
to jenkinsc...@googlegroups.com
Baptiste Mathus updated an issue
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 {{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).

scm_issue_link@java.net (JIRA)

unread,
Nov 14, 2016, 7:07:05 AM11/14/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-39689
 
Re: Docker-java shaded jar should not embed an old version of tiger_types (used by Stapler)

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_issue_link@java.net (JIRA)

unread,
Nov 14, 2016, 7:07:07 AM11/14/16
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages