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

Rocket.chat failes to serve RocketChatNotifier/testConnection

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.249.3(docker jenkins/jenkins:lts-centos7)
      rocketchatnotifier 1.4.9
      apache-httpcomponents-client-4-api 4.5.10-2.0

      When trying to configure rocket chat jenkins plugin and test connections, it throws

      Error while serving https://domain-name.test/descriptorByName/jenkins.plugins.rocketchatnotifier.RocketChatNotifier/testConnection
      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.Unirest.setHttpClient(Unirest.java:49)
      	at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientCallBuilder.<init>(RocketChatClientCallBuilder.java:78)
      	at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientCallBuilder.<init>(RocketChatClientCallBuilder.java:66)
      	at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientImpl.<init>(RocketChatClientImpl.java:59)
      	at jenkins.plugins.rocketchatnotifier.RocketClientWebhookImpl.<init>(RocketClientWebhookImpl.java:30)
      	at jenkins.plugins.rocketchatnotifier.RocketChatNotifier$DescriptorImpl.doTestConnection(RocketChatNotifier.java:625)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      Caused: java.lang.reflect.InvocationTargetException
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:400)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
      	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:536)
      ...

      And

      Caught unhandled exception with ID 754255cf-65f2-44c3-921f-2eaa418c5944
      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.Unirest.setHttpClient(Unirest.java:49)
      	at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientCallBuilder.<init>(RocketChatClientCallBuilder.java:78)
      	at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientCallBuilder.<init>(RocketChatClientCallBuilder.java:66)
      	at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientImpl.<init>(RocketChatClientImpl.java:59)
      	at jenkins.plugins.rocketchatnotifier.RocketClientWebhookImpl.<init>(RocketClientWebhookImpl.java:30)
      	at jenkins.plugins.rocketchatnotifier.RocketChatNotifier$DescriptorImpl.doTestConnection(RocketChatNotifier.java:625)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
      	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:536)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
      Caused: javax.servlet.ServletException
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:816)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
      	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:281)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:694)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
      ...

      but its ok from jenkins host container with curl

      curl -H "Content-type:application/json" \ https://chat-domain.test/api/v1/login \ -d '{ "user": "myusername", "password": "mypassword" }'

            mreinhardt Martin Reinhardt
            SpaceCowboyMax Max Val
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: