詹金斯构建错误 java.lang.ClassNotFoundException: hudson.remoting.Launcher
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11556404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jenkins Build error java.lang.ClassNotFoundException: hudson.remoting.Launcher
提问by ghTvNath
I am trying to integrate jenkins with svn. I have configured maven_home, java_home (java 1.5 update 22). I am using jenkins version 1.459 . One of my colleague successfully configured jenkins with the svn.But as now we are using a different branch, I wanted to add a new job so that it checkout from the new branch and continuous integrate the project. Jenkins is running in a remote linux machine and I use vpn to connect to the server and set up the things.What am I missing.
我正在尝试将 jenkins 与 svn 集成。我已经配置了 maven_home、java_home(java 1.5 更新 22)。我正在使用 jenkins 版本 1.459 。我的一位同事成功地使用 svn 配置了 jenkins。但是由于现在我们使用的是不同的分支,我想添加一个新作业,以便它从新分支检出并持续集成项目。Jenkins 在远程 linux 机器上运行,我使用 vpn 连接到服务器并设置东西。我错过了什么。
Modules changed, recalculating dependency graph
[workspace] $ /usr/lib/jvm/jdk1.5.0_22/bin/java -cp /home/vimukthi/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/home/vimukthi/.jenkins/tools/Maven_3.0.3/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /home/vimukthi/.jenkins/tools/Maven_3.0.3 /tmp/Jetty_0_0_0_0_2080_jenkins.war__jenkins__.wq5y0j/webinf/WEB-INF/lib/remoting-2.13.jar /home/vimukthi/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 45339
Exception in thread "main" java.lang.ClassNotFoundException: hudson.remoting.Launcher
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.jvnet.hudson.maven3.agent.Maven3Main.main(Maven3Main.java:130)
at org.jvnet.hudson.maven3.agent.Maven3Main.main(Maven3Main.java:63)
ERROR: Failed to parse POMs
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at hudson.remoting.ClassicCommandTransport.create(ClassicCommandTransport.java:98)
at hudson.remoting.Channel.<init>(Channel.java:373)
at hudson.remoting.Channel.<init>(Channel.java:369)
at hudson.remoting.Channel.<init>(Channel.java:330)
at hudson.remoting.Channel.<init>(Channel.java:326)
at hudson.remoting.Channel.<init>(Channel.java:322)
at hudson.slaves.Channels.<init>(Channels.java:71)
at hudson.slaves.Channels.forProcess(Channels.java:71)
at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:237)
at hudson.maven.ProcessCache.get(ProcessCache.java:231)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:706)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
at hudson.model.Run.run(Run.java:1413)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:479)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Sending e-mails to: [email protected]
Finished: FAILURE
回答by Draco Ater
Looks like I managed to solve the problem. Disconnecting and reconnecting the slave solves it only temporarily. But what I did is, I changed the java that master and slaves run with. Now my slaves and master run with exactly the same version of java (6u41 32bit) and it's about 3 weeks we don't face this kind of problems.
看起来我设法解决了这个问题。断开并重新连接从站只能暂时解决它。但是我所做的是,我更改了主从运行的 java。现在我的奴隶和主人使用完全相同的 java 版本(6u41 32 位)运行,大约 3 周我们不会遇到这种问题。
回答by jayunit100
This error can be reproduced by corrupting the libraries in the slave's build root directory. In that case, reconnecting the slave fixes the situation, because by reconnecting a slave, jenkins copies over all the necessary libraries etc..
可以通过破坏从站构建根目录中的库来重现此错误。在这种情况下,重新连接从站可以解决问题,因为通过重新连接从站,詹金斯会复制所有必要的库等。
TO see this in action, watch the jenkins console when you reconnect, you will see something like this:
要查看此操作,请在重新连接时查看 jenkins 控制台,您将看到如下内容:
Slave.jar version: 2.28
This is a Unix slave
Copied maven-agent.jar
Copied maven3-agent.jar Copied maven3-interceptor.jar
Copied maven-interceptor.jar
Copied maven2.1-interceptor.jar Copied plexus-classworld.jar
Copied classworlds.jar
Slave.jar 版本:2.28
这是一个Unix奴隶
复制maven-agent.jar
复制的 maven3-agent.jar 复制的 maven3-interceptor.jar
复制maven-interceptor.jar
复制的 maven2.1-interceptor.jar 复制的 plexus-classworld.jar
复制classworlds.jar
So, whats happening, is all the libraries are resync'd by jenkins. This can be chalked up to a bug (imho) in jenkins... Ideally the slaves should be robust to these kind of failures.
所以,发生了什么,所有的库都被詹金斯重新同步了。这可以归结为 jenkins 中的一个错误(恕我直言)......理想情况下,奴隶应该对这些类型的失败保持健壮。
回答by Amit
I have seen this issue couple of times in our test environment and providing slave.jar solved this issue.
我在我们的测试环境中多次看到这个问题,提供 slave.jar 解决了这个问题。
Unfortunately there was a job which only moved maven-agent* and not slave.jar whenever environment was rebuilt, and we used to face this issue repeatedly.
不幸的是,有一个工作在环境重建时只移动 maven-agent* 而不是 slave.jar,我们曾经反复面对这个问题。
Copying slave.jar fixed this issue.
复制 slave.jar 修复了这个问题。