jenkinsci / discord-notifier-plugin

A post-build plugin that sends the build status to a Discord channel.
https://plugins.jenkins.io/discord-notifier/
MIT License
50 stars 25 forks source link

Clean 2.289.2 LTS LinkageError #38

Closed SabinoWS closed 3 years ago

SabinoWS commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins: 2.289.2 LTS 
Discord Notifier: 1.4.14
Docker image jenkins/jenkins:lts-centos7

Reproduction steps

Results

Expected result: Expected to send a notification to Discord

Actual result: LinkageError

ERROR: Step ?Discord Notifier? aborted due to exception: 
java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.impl.auth.HttpAuthenticator.<init>(Lorg/apache/commons/logging/Log;)V" the class loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2) of the current class, org/apache/http/impl/nio/client/MainClientExec, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/apache/http/impl/auth/HttpAuthenticator, have different Class objects for the type org/apache/commons/logging/Log used in the signature
    at org.apache.http.impl.nio.client.MainClientExec.<init>(MainClientExec.java:111)
    at org.apache.http.impl.nio.client.HttpAsyncClientBuilder.build(HttpAsyncClientBuilder.java:849)
    at com.mashape.unirest.http.options.Options.refresh(Options.java:93)
    at com.mashape.unirest.http.options.Options.<clinit>(Options.java:46)
    at com.mashape.unirest.http.HttpClientHelper.prepareRequest(HttpClientHelper.java:151)
    at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:131)
    at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)
    at nz.co.jammehcow.jenkinsdiscord.DiscordWebhook.send(DiscordWebhook.java:208)
    at nz.co.jammehcow.jenkinsdiscord.WebhookPublisher.perform(WebhookPublisher.java:293)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
    at hudson.model.Build$BuildExecution.cleanUp(Build.java:187)
    at hudson.model.Run.execute(Run.java:1953)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Finished: SUCCESS

update

Sorry, it was the wrong Java version (8) inside the container. When updated to Java 11 it worked fine.