[JIRA] (JENKINS-13632) AbstractMethodError with PTC Integrity Plugin

1 view
Skip to first unread message

martin.bickel@continental-corporation.com (JIRA)

unread,
Feb 10, 2020, 12:09:02 PM2/10/20
to jenkinsc...@googlegroups.com
Martin Bickel commented on Bug JENKINS-13632
 
Re: AbstractMethodError with PTC Integrity Plugin

We encountered the same problem in our own plugin that uses mksapi - and were able to solve it.

The classloader of Jenkins plugins prefers classes from other plugins or Jenkins core to the classes bundled in the plugin itself, as documented here:

https://jenkins.io/doc/developer/plugin-development/dependencies-and-class-loading/

 

If the Jenkins installation already contains a different version of org.apache.commons.httpclient.HttpConnection , you get this problem. That's why it's difficult to reproduce in another installation, because it depends on the exact version of plugins installed.

We solved it in our plugin by configuring the classloader of our plugin to use its own classes for the given packages. Excerpt from POM.xml

<plugin>
 <groupId>org.jenkins-ci.tools</groupId>
 <artifactId>maven-hpi-plugin</artifactId>
 <configuration>
   <maskClasses>
     org.apache.commons.httpclient.
     org.apache.commons.httpclient.auth.
     org.apache.commons.httpclient.cookie.
     org.apache.commons.httpclient.methods.
     org.apache.commons.httpclient.methods.multipart.
     org.apache.commons.httpclient.protocol.
     org.apache.commons.httpclient.util.
   </maskClasses>
  </configuration>
 </plugin>

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages