InjectedTest error when using plugin parent 2.3

63 views
Skip to first unread message

Tomas Bjerre

unread,
Mar 7, 2016, 3:30:39 PM3/7/16
to Jenkins Developers
I'm getting an error when trying to use the new plugin parent 2.3.

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: /usr/local/apache-maven-3.3.3
Java version: 1.8.0_74, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: sv_SE, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-79-generic", arch: "amd64", family: "unix"


Here is the stacktrace:

Running InjectedTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.689 sec <<< FAILURE! - in InjectedTest
org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest)  Time elapsed: 0.011 sec  <<< ERROR!
java.lang.NoClassDefFoundError: org/apache/http/config/Lookup
at com.gargoylesoftware.htmlunit.WebClient.createWebConnection(WebClient.java:1956)
at com.gargoylesoftware.htmlunit.WebClient.init(WebClient.java:236)
at com.gargoylesoftware.htmlunit.WebClient.<init>(WebClient.java:211)
at org.jvnet.hudson.test.HudsonTestCase$WebClient.<init>(HudsonTestCase.java:1486)
at org.jvnet.hudson.test.HudsonTestCase.createWebClient(HudsonTestCase.java:1473)
at org.jvnet.hudson.test.HudsonTestCase.executeOnServer(HudsonTestCase.java:1458)
at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.runGroupedTests(JellyTestSuiteBuilder.java:157)
at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:51)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.ClassNotFoundException: org.apache.http.config.Lookup
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.gargoylesoftware.htmlunit.WebClient.createWebConnection(WebClient.java:1956)
at com.gargoylesoftware.htmlunit.WebClient.init(WebClient.java:236)
at com.gargoylesoftware.htmlunit.WebClient.<init>(WebClient.java:211)
at org.jvnet.hudson.test.HudsonTestCase$WebClient.<init>(HudsonTestCase.java:1486)
at org.jvnet.hudson.test.HudsonTestCase.createWebClient(HudsonTestCase.java:1473)
at org.jvnet.hudson.test.HudsonTestCase.executeOnServer(HudsonTestCase.java:1458)
at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.runGroupedTests(JellyTestSuiteBuilder.java:157)
at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:51)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)



Andres Rodriguez

unread,
Mar 7, 2016, 5:44:49 PM3/7/16
to jenkin...@googlegroups.com
Hi Tomas,

The parent pom 2.3 uses by default the split JTH 2.1, which uses HtmlUnit 2.18 which depends on org.apache.httpcomponents:httpclient:jar:4.5.

You should look in your dependency tree for conflicting dependencies and resolve them.

If you post the result of `mvn dependency:tree` I can try to have a look.

Regards,

Andres


--
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/4cbdae20-f052-4754-b647-db84b36c4b71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards,

Andres Rodriguez

Jesse Glick

unread,
Mar 7, 2016, 7:50:13 PM3/7/16
to Jenkins Dev
On Mon, Mar 7, 2016 at 5:44 PM, Andres Rodriguez
<arodr...@cloudbees.com> wrote:
> You should look in your dependency tree for conflicting dependencies and
> resolve them.

Example:

https://github.com/jenkinsci/pipeline-stage-view-plugin/commit/c83c436aee00f1b02922cfa346f2ad33b3b044a3

Oleg Nenashev

unread,
Apr 18, 2016, 2:21:42 AM4/18/16
to Jenkins Developers
In my case is has been caused by the outdated dependency in parent pom (2.6)

[INFO] org.jenkins-ci.plugins:promoted-builds:hpi:2.26-SNAPSHOT
[INFO] +- org.jenkins-ci.main:maven-plugin:jar:2.0:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.2.4:compile

httpcore 4.3+ is required to make it operational.
Another similar issue in my tests: https://github.com/groupon/DotCi/pull/213/files

I would propose to add explicit lib dependencies to the parent POM.
@Andres WDYT?

вторник, 8 марта 2016 г., 1:50:13 UTC+1 пользователь Jesse Glick написал:

Andres Rodriguez

unread,
Apr 18, 2016, 5:29:59 AM4/18/16
to jenkin...@googlegroups.com
We could include them, so that they get correctly resolved. The thing is that given the JTH version is configurable, some coordination between some versions would be needed (maybe using profiles)...
Of course, this would be a transient situation for older plugins in the new parent pom but we should take care of it 

--
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.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages