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

Artifactory server configuration throwing 'loader constraint violation' error

      When i tried to add my artifactory server then its throwing the error like,
       

         
           

      ERROR
      A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.

      Stack trace

      javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.impl.client.HttpClientBuilder.setDefaultCredentialsProvider(Lorg/apache/http/client/CredentialsProvider;)Lorg/apache/http/impl/client/HttpClientBuilder;" the class loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2) of the current class, org/jfrog/build/client/PreemptiveHttpClient, and the class loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2) for the method's defining class, org/apache/http/impl/client/HttpClientBuilder, have different Class objects for the type org/apache/http/client/CredentialsProvider used in the signature at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.impl.client.HttpClientBuilder.setDefaultCredentialsProvider(Lorg/apache/http/client/CredentialsProvider;)Lorg/apache/http/impl/client/HttpClientBuilder;" the class loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2) of the current class, org/jfrog/build/client/PreemptiveHttpClient, and the class loader (instance of hudson/ClassicPluginStrategy$AntClassLoader2) for the method's defining class, org/apache/http/impl/client/HttpClientBuilder, have different Class objects for the type org/apache/http/client/CredentialsProvider used in the signature at org.jfrog.build.client.PreemptiveHttpClient.createHttpClientBuilder(PreemptiveHttpClient.java:117) at org.jfrog.build.client.PreemptiveHttpClient.<init>(PreemptiveHttpClient.java:72) at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:125) at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:120) at org.jfrog.build.client.ArtifactoryHttpClient.getVersion(ArtifactoryHttpClient.java:133) at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.verifyCompatibleArtifactoryVersion(ArtifactoryBuildInfoClient.java:294) at org.jfrog.hudson.ArtifactoryBuilder$DescriptorImpl.doTestConnection(ArtifactoryBuilder.java:174) at sun.reflect.GeneratedMethodAccessor1394.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:320) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:163) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) ... 49 more
       
      Is there any thing am missing or is it bug in plugin ?

          [JENKINS-42792] Artifactory server configuration throwing 'loader constraint violation' error

          Whatever the problem is, it looks like it was introduced in v2.9.0 of the Artifactory plugin. v2.8.2 does not exibit the error.

           

          And I'm running Jenkins core v1.642.4 btw in case that helps isolate the problem.

          Kevin Phillips added a comment - Whatever the problem is, it looks like it was introduced in v2.9.0 of the Artifactory plugin. v2.8.2 does not exibit the error.   And I'm running Jenkins core v1.642.4 btw in case that helps isolate the problem.

          Oh, and I re-ran my same test on a Jenkins 2 sandbox I have (core v2.46.1) and was unable to reproduce the error. My sandbox has the same plugins installed as our Jenkins 1 server but it has all the latest versions of them installed, so it's not quite a one-to-one comparison. However, perhaps the Jenkins core version is partially to blame for this problem as well.

          Kevin Phillips added a comment - Oh, and I re-ran my same test on a Jenkins 2 sandbox I have (core v2.46.1) and was unable to reproduce the error. My sandbox has the same plugins installed as our Jenkins 1 server but it has all the latest versions of them installed, so it's not quite a one-to-one comparison. However, perhaps the Jenkins core version is partially to blame for this problem as well.

          Aditya C S added a comment -

          I am facing this issue in InfluxDB plugin as well.

          Aditya C S added a comment - I am facing this issue in InfluxDB plugin as well.

          From the stacktrace, it looks like the issue is caused as a result of a dependency collision between two Jenkins plugins. One of the plugins uses an older version of Apache Http Client. Upgrading the client by the plugin should resolve the collision.

          Eyal Ben Moshe added a comment - From the stacktrace, it looks like the issue is caused as a result of a dependency collision between two Jenkins plugins. One of the plugins uses an older version of Apache Http Client. Upgrading the client by the plugin should resolve the collision.

          Aditya C S added a comment -

          eyalbe Is there a way to identify which plugin is causing this problem?

          Aditya C S added a comment - eyalbe Is there a way to identify which plugin is causing this problem?

          Aditya C S added a comment - - edited

          eyalbe I had similar issue in InfluxDB plugin(https://issues.jenkins-ci.org/browse/JENKINS-44669). I have tried updating the library(httpcore) to latest version. Even then issue persists. 

          Aditya C S added a comment - - edited eyalbe I had similar issue in InfluxDB plugin( https://issues.jenkins-ci.org/browse/JENKINS-44669 ). I have tried updating the library(httpcore) to latest version. Even then issue persists. 

          Having same problem on Windows:

          Jenkins ver. 1.611   -  ArtifactoryPlugin 2.12.2

          Jenkins ver. 1.609.3  - ArtifactoryPlugin 2.12.2 (clean install of Jenkins with no other plugin instead of Artifactory)

          bahadir guldiken added a comment - Having same problem on Windows: Jenkins ver. 1.611    -  ArtifactoryPlugin  2.12.2 Jenkins ver. 1.609.3   - ArtifactoryPlugin  2.12.2  (clean install of Jenkins with no other plugin instead of Artifactory)

          I'm experiencing the same issue. Jenkins 1.651.1 and Artifactory plugin 2.13.1.

          Anna Tikhonova added a comment - I'm experiencing the same issue. Jenkins 1.651.1 and Artifactory plugin 2.13.1.

          The same

          Jenkins: 1.651.3

          Artifactory : 2.13.1

          Kirill Fedoseev added a comment - The same Jenkins: 1.651.3 Artifactory : 2.13.1

          bahadir_g,
          I see that you got this error with a clean Jenkins 1.6 installation, having only the latest Artifactory Plugin installed.
          I'm rally curious to know if you'd experience this with a Jenkins 2.x installation.
          The cause of the conflict seems to be clear - an older http client version is loaded by the JVM and the Artifactory Plugin (which is compiled with another version of the client) crashes.
          If we modify the Artifactory Plugin and have it use an older version of the client, this issue will be probably resolved, the other features, such as SNI support will be lost.
          Can anyone please try this with a clean Jenkins 2.x instance (should be very easy to setup locally) having only the Artifactory Plugin installed?

          Eyal Ben Moshe added a comment - bahadir_g , I see that you got this error with a clean Jenkins 1.6 installation, having only the latest Artifactory Plugin installed. I'm rally curious to know if you'd experience this with a Jenkins 2.x installation. The cause of the conflict seems to be clear - an older http client version is loaded by the JVM and the Artifactory Plugin (which is compiled with another version of the client) crashes. If we modify the Artifactory Plugin and have it use an older version of the client, this issue will be probably resolved, the other features, such as SNI support will be lost. Can anyone please try this with a clean Jenkins 2.x instance (should be very easy to setup locally) having only the Artifactory Plugin installed?

            eyalbe Eyal Ben Moshe
            ranjith31 Ranjith Kumar
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: