NoClassDefFoundError for hudson/slaves/CommandLauncher

365 views
Skip to first unread message

pallen

unread,
Sep 20, 2018, 6:43:11 AM9/20/18
to Jenkins Developers
Hi Guys,

I have been investigating an issue that seems to disable all Perforce MultiBranch support when I moved from Jenkins 2.107.2 to 2.121.3.

I recently upgraded the p4-plugin POM (https://github.com/jenkinsci/p4-plugin/blob/master/pom.xml) and I might have used an incompatable dependacy?

The plugin seems to compile correctly and installs without any noticeable errors, only when you go to the configuration page for MultiBranch Sources do you find that the issue. 

I tried bumping the jenkins.version in the POM to 2.121.3 and running my tests, however they all fail with the following...


[INFO] Running InjectedTest

[ERROR] Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.007 s <<< FAILURE! - in InjectedTest

[ERROR] initializationError(InjectedTest)  Time elapsed: 0 s  <<< ERROR!

java.lang.NoClassDefFoundError: hudson/slaves/CommandLauncher

at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.<init>(JellyTestSuiteBuilder.java:139)

at org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.<init>(JellyTestSuiteBuilder.java:138)

at org.jvnet.hudson.test.JellyTestSuiteBuilder.build(JellyTestSuiteBuilder.java:80)

at org.jvnet.hudson.test.PluginAutomaticTestBuilder.build(PluginAutomaticTestBuilder.java:63)

at InjectedTest.suite(InjectedTest.java:17)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.junit.internal.runners.SuiteMethod.testFromSuiteMethod(SuiteMethod.java:35)

at org.junit.internal.runners.SuiteMethod.<init>(SuiteMethod.java:24)

at org.junit.internal.builders.SuiteMethodBuilder.runnerForClass(SuiteMethodBuilder.java:11)

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)

at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)

at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)

at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:362)

at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272)

at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:236)

at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)

at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)

at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)

at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)

Caused by: java.lang.ClassNotFoundException: hudson.slaves.CommandLauncher

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 23 more


Perhaps I just have Maven all messed up, but I can't seem to figure out what is happening.

Any help would be appreciated.

Kind regards,
Paul

Antonio Muñiz

unread,
Sep 20, 2018, 6:49:46 AM9/20/18
to jenkin...@googlegroups.com
CommandLauncher was detached from core some time ago (cf. https://github.com/jenkinsci/jenkins/pull/3076)
Maybe you have to add a new dependency to the detached plugin in your pom (https://github.com/jenkinsci/command-launcher-plugin).

--
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/d80068bf-c893-47ef-855d-de4960e36ae1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Antonio Muñiz
Software Engineer
CloudBees, Inc.

pallen

unread,
Sep 20, 2018, 7:05:54 AM9/20/18
to Jenkins Developers
Thanks for the quick reply - I just spotted that too and it's fixed the test issue. :-)

I don't think that will address the MultiBranch SCM support, but just waiting for the build and tests to finish.

Perhaps there are other plugins that I might be missing in my POM? 

Antonio Muñiz

unread,
Sep 20, 2018, 7:20:29 AM9/20/18
to jenkin...@googlegroups.com
I don't think so, but I don't have enough information, what's the JIRA ticket?
 

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

pallen

unread,
Sep 20, 2018, 11:47:40 AM9/20/18
to Jenkins Developers
The issue was internal to Perforce (one of our customers).

However I can confirm that the missing 'command-launcher' was the cause of both test and MultiBranch failures.

Unfortunately if I add the 'command-launcher' dependency I will have to up my min Jenkins version (I normally try to support up to 2 years)...

Command Agent Launcher Plugin v1.2 failed to load.
 - You must update Jenkins from v2.60.3 to v2.86 or later to run this plugin.

Kind regards,
Paul

Daniel Beck

unread,
Sep 20, 2018, 10:05:52 PM9/20/18
to jenkin...@googlegroups.com


> On 20. Sep 2018, at 08:47, pallen <pal...@perforce.com> wrote:
>
> I will have to up my min Jenkins version (I normally try to support up to 2 years)...

FYI here's some data on your users:
https://stats.jenkins.io/pluginversions/p4.html

98% of 1.8.15 plugin installs are on 2.89.1 or newer.
95% of 1.8.14 installs…
97% of 1.8.12 installs…
95% of 1.8.10 installs…
93% of 1.8.9 installs…
95% of 1.8.8 installs…
92% of 1.8.7 installs…
91% of 1.8.6 installs…
88% of 1.8.5 installs…
87% of 1.8.4 installs…

And that's all the 2018 releases of your plugin.

It looks like only relatively few users are on old cores while actually upgrading your plugin this year so far.

Antonio Muñiz

unread,
Sep 24, 2018, 3:32:28 AM9/24/18
to jenkin...@googlegroups.com
I guess there will be a bunch of instances not reporting data, and those instances are the ones on old versions (...big corporations).

Anyways, if a plugin is not directly relying on command-launcher I don't a reason to add a dependency to it. Maybe Jesse (who actually worked on the extraction) can shed some light on this.

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

Jesse Glick

unread,
Sep 24, 2018, 2:04:31 PM9/24/18
to Jenkins Dev
On Thu, Sep 20, 2018 at 6:49 AM Antonio Muñiz <amu...@cloudbees.com> wrote:
> CommandLauncher was detached from core some time ago
> Maybe you have to add a new dependency to the detached plugin in your pom

No, you should not need to do that. You are just using a parent POM
more than a year out of date.

https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md#237
Reply all
Reply to author
Forward
0 new messages