LinkageError

23 views
Skip to first unread message

Ivo Bellin Salarin

unread,
Jul 16, 2015, 9:09:42 AM7/16/15
to jenkin...@googlegroups.com
Hi all,

I am experiencing the following error:

java.lang.LinkageError: loader constraint violation: when resolving method "org.jfrog.build.client.ArtifactoryHttpClient.upload(Lorg/apache/http/client/methods/HttpPut;Lorg/apache/http/HttpEntity;)Lorg/jfrog/build/client/ArtifactoryUploadResponse;" the class loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2) of the current class, org/jenkinsci/plugins/greenproject/MyArtifactoryClient, and the class loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2) for the method's defining class, org/jfrog/build/client/ArtifactoryHttpClient, have different Class objects for the type org/apache/http/client/methods/HttpPut used in the signature

In my plugin I reference Artifactory plugin 2.3.1 and a lot of other plugins. A full dependency tree is available in the gist (https://gist.github.com/nilleb/c08c0c11e0b74a98a694).

The 'MyArtifactoryClient' class extends a class from the artifactory plugin, which composes an ArtifactoryHttpClient to complete its task.

If I'm not wrong, the exception stack above means that the HttpPut parameter that I'm passing from my class to the ArtifactoryHttpClient is not of the same type expected by the receiver. How's that possible?

I've tried to reference the same package (org.apache.httpcomponents) at the same version exposed by the artifactory plugin. But this hasn't improved the situation.

How can I solve this error? Is there any equivalent of the binding redirects in Java(hudson/ClassicPluginStrategy$AntClassLoader)?

Oleg Nenashev

unread,
Jul 23, 2015, 5:57:13 PM7/23/15
to Jenkins Developers, ivo.bell...@gmail.com
I suppose you've got into the binary compatibility issues somewhere. Two plugins may depend on different versions of a same library. If they do not use shading, there is a risk of such collisions in method signatures.

четверг, 16 июля 2015 г., 16:09:42 UTC+3 пользователь Ivo Bellin Salarin написал:
Reply all
Reply to author
Forward
0 new messages