-
Bug
-
Resolution: Fixed
-
Major
-
Jenkins 2.140 / SSH Slaves Plugin 1.27
-
-
ssh-slaves-1.28
The usage of the environment variable JAVA_HOME (set via Node Properties) to specify the Java installation path results in the following exception when connecting:
ERROR: Unexpected error in launching a agent. This is probably a bug in Jenkins.
java.lang.UnsupportedOperationException
{{ at java.util.AbstractList.add(Unknown Source)}}
{{ at java.util.AbstractList.add(Unknown Source)}}
{{ at hudson.plugins.sshslaves.DefaultJavaProvider.lookForJavaHome(DefaultJavaProvider.java:94)}}
{{ at hudson.plugins.sshslaves.DefaultJavaProvider.getJavas(DefaultJavaProvider.java:76)}}
{{ at hudson.plugins.sshslaves.JavaVersionChecker.resolveJava(JavaVersionChecker.java:72)}}
{{ at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:851)}}
{{ at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:821)}}
{{ at java.util.concurrent.FutureTask.run(Unknown Source)}}
{{ at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)}}
{{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)}}
{{ at java.lang.Thread.run(Unknown Source)}}
I guess this is related to the following code, which tries to add a path to an immutable list:
private List<String> lookForJavaHome(Node node) { List<String> ret = Collections.emptyList(); if(node != null && node.getNodeProperties() != null){ for (NodeProperty property : node.getNodeProperties()){ if(property instanceof EnvironmentVariablesNodeProperty){ EnvVars env = ((EnvironmentVariablesNodeProperty) property).getEnvVars(); if (env != null && env.containsKey(JAVA_HOME)) { ret.add(env.get(JAVA_HOME) + BIN_JAVA); } } } } return ret; }
- is duplicated by
-
JENKINS-53244 UnsupportedOperationException in DefaultJavaProvider.lookForTools
- Resolved
- links to