Riddle me this:
How can two nearly identical jenkins slaves running with Oracle JDK 1.8 u60 Java have one fail to collect artifact with a classdef error while the other is fine? In both case the following are identical
Note I can replicate this by going to script console and running the following
import org.apache.tools.ant.Location
Location l = new Location()
works on the good and fails in same way as a real build on the bad.
Error
java.io.IOException: remote file operation failed:... at
hudson.remoting.Channel@35f2fb2:linengbld50: java.io.IOException:
Remote call on linengbld50 failed
...
Caused by: java.io.IOException: Remote call on linengbld50 failed
...
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
org.apache.tools.ant.Location
...
Yum difference
Good v Bad
Only ON Bad
Using Script console was a great debugging tools as it executes in the right environment. getting output of which java
on each node showed a difference. @mmasi found that bad showed a path whereas good returned null.
Even though we run slave using specific JDK java it used first java found on path for its activities (archiving).
modify alternatives to set java to 1.8 (centos)
sudo alternatives --install /usr/bin/java java \\ /opt/tools/Java/jdk1.8.0_60/bin/java 1;java -version
Disconnect and reconnect node (restart the slave)
Repeat the tiny script console check OK
Repeat Build test (tiny build that archives a file) OK
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.