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

java.lang.NoSuchMethodError on hitting TestConnection

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • Ubuntu VM with docker installed is running a jenkins image. Docker client is installed in the container and docker unix socket is mapped to the host so that docker commands can be run inside container using host's docker daemon.

      I am running jenkins inside a container (using the official jenkins image). I have done a volume mapping of -v /var/run/docker.sock:/var/run/docker.sock so that I can run docker commands within the container, using the host's docker daemon.

      For setting up the Docker Build step plugin under "Configure System" -> "Docker Builder", when I enter "Docker URL" as "unix:///var/run/docker.sock", I get the below error :

      javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.http.impl.client.HttpClientBuilder.setConnectionManagerShared(Z)Lorg/apache/http/impl/client/HttpClientBuilder;
      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)

      So I tried to expose a tcp socket for the docker daemon on the host. I was able to expose "tcp://13.65.82.196:2375" and I made sure that this port was accessible through firewall. I am able to run docker commands against this URL from within the container. I tested that out with the command "curl -X GET http://13.65.82.196:2375/info" and it works. Next, when I enter "tcp://13.65.82.196:2375" as the Docker URL, I get the same error as before.

      Please note that I "Apply" the setting before I hit "Test Connection".
      Can someone please help with this?

          [JENKINS-40969] java.lang.NoSuchMethodError on hitting TestConnection

          Dockerstep plugin depends on httpclient 4.3.6 (/DATA/jenkins/plugins/docker-build-step/WEB-INF/lib ) which does not have this method "org.apache.http.impl.client.HttpClientBuilder.setConnectionManagerShared" . By updating the pom.xml to point to 4.5.2, this might work?

          Parvathy Geetha added a comment - Dockerstep plugin depends on httpclient 4.3.6 (/DATA/jenkins/plugins/docker-build-step/WEB-INF/lib ) which does not have this method " org.apache.http.impl.client.HttpClientBuilder.setConnectionManagerShared " . By updating the pom.xml to point to 4.5.2, this might work?

          Code changed in jenkins
          User: parvathy-g
          Path:
          pom.xml
          http://jenkins-ci.org/commit/docker-build-step-plugin/208ef9c9a85af03ef9bb281efbb9f6b670242242
          Log:
          Update pom.xml

          To introduce httpclient-4.5.2 . ISSUE NO JENKINS-40969

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: parvathy-g Path: pom.xml http://jenkins-ci.org/commit/docker-build-step-plugin/208ef9c9a85af03ef9bb281efbb9f6b670242242 Log: Update pom.xml To introduce httpclient-4.5.2 . ISSUE NO JENKINS-40969

            vjuranek vjuranek
            pragya15 Pragya Mehta
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: