httpclient errors while working on upgrading and cleaning up pom file

823 views
Skip to first unread message

Gavin Mogan

unread,
Jul 17, 2016, 12:42:36 AM7/17/16
to Jenkins Developers
I'm working on upgrading my pom file to work with the new 2.0 style parent plugin and harness but hitting road blocks again. I wasn't getting this error when I was running things on my macbook, but am getting it on my linux desktop.

Tests run: 6, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 49.411 sec <<< FAILURE! - in InjectedTest
org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest)  Time elapsed: 0.002 sec  <<< ERROR!
java.lang.NoClassDefFoundError: org/apache/http/config/Lookup
Caused by: java.lang.ClassNotFoundException: org.apache.http.config.Lookup


I've been trying to dig into this, but I can't figure out why this is failing, httpclient seems to be required by various plugins. I'm not directly requiring it, but I've tried and it still gives the error.

Any suggestions on what to do next would be greatly appreciated.

Debugging Information:

$ mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /opt/apache-maven-3.3.9
Java version: 1.8.0_31, vendor: Oracle Corporation
Java home: /opt/jdk1.8.0_31/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-327.22.2.el7.x86_64", arch: "amd64", family: "unix"

$ mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:list | grep httpclient
[INFO]    commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO]    org.apache.httpcomponents:httpclient:jar:4.2.5:compile


Gavin Mogan

unread,
Jul 17, 2016, 12:50:22 AM7/17/16
to jenkin...@googlegroups.com
Oh the reason I'm saying its httpclient, which may not be super clear from this error, is that its also erroring when I call jenkinsRule.getWebClient()

ex:

doJobReportTest(hudson.plugins.sauce_ondemand.SauceOnDemandBuildActionTest)  Time elapsed: 10.082 sec  <<< ERROR!
java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager
        at hudson.plugins.sauce_ondemand.SauceOnDemandBuildActionTest.doJobReportTest(SauceOnDemandBuildActionTest.java:59)
Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.HttpClientConnectionManager
        at hudson.plugins.sauce_ondemand.SauceOnDemandBuildActionTest.doJobReportTest(SauceOnDemandBuildActionTest.java:59)

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/dcpB0dEzbVM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1d3d1e0a-cae5-4535-b3fe-4803f52b5514%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kanstantsin Shautsou

unread,
Jul 17, 2016, 8:37:46 AM7/17/16
to Jenkins Developers
You should remember that jenkins has no classloader isolation and your project must use httpclient library version the first loaded into jenkins (could be from core or plugin). 
Check :dependency-tree

Robert Sandell

unread,
Jul 18, 2016, 5:15:22 AM7/18/16
to jenkin...@googlegroups.com
Yes, you most likely have multiple versions of httpclient on your classpath, and the reason for it working on one system but not the other could be because the classpath is constructed in another order, so you get an older version on the classpath before a newer one.

/B

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5bcf9521-6805-4dc0-b0a3-e09deb074d17%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

Jesse Glick

unread,
Jul 26, 2016, 3:45:44 PM7/26/16
to Jenkins Dev
On Mon, Jul 18, 2016 at 5:15 AM, Robert Sandell <rsan...@cloudbees.com> wrote:
> you most likely have multiple versions of httpclient on your classpath

Yes, use `mvn dependency:tree`, and generally either add an
`<exclude>` for the old one, or add an explicit dependency on a newer
one.
Reply all
Reply to author
Forward
0 new messages