Javaws fails to run on agent

  1. Is there a way to essentially “close” a previous topic?

  2. Full reload of Jenkins (from 2.213 > 2.504) in a new directory and copied the node/jobs over. EVERYTHING is happy EXCEPT:

Since Java had to be upgraded, I installed M$ open Java 21. Also - I had to install OpenWebStart from OpenWebStart . org.

The agent launches and tries to run the following legacy command (it DOES use OpenWebStart to do it…):
javaws http://jenkins1:9191/computer/vm-test-10x64c/slave-agent.jnlp

OpenWebStart (javaws) fails and says it cannot parse or run the jnlp file. If I download the file and try to run, I get the same error.

The downloaded jnlp is:
jnlp

The modern way to connect inbound agents to Jenkins is to use webSockets. On the agent page you get the command that you can use to start the agent.

Is there a setup in the jenkins doc on this? I’m apparently looking in the wrong place (I have NOT liked using JAVA like this in the first place!)

just go to the agents page in Jenkins. If the agent is not connected it should print you the command that you have to execute.

I guess I should note that our “agents” are VM’s running in a VMWare system. I have defined a cloud (and maybe I don’t have to since any agent “node” points to a specific machine. But they VM is shutdown after use and snapshot reverted. I don’t see those options if create a new permanent agent.

Our system utilizes several unique vm’s manged by vsphere. Different windows versions, so we can launch a vm, have it run scripts and install/test our software, then shut down and revert to a clean state after each run.

So, what used to work (and we don’t seem to be able to go back and make it work) was - Jenkins 2.213 and JAVA 8.

  • Jenkins would launch the vSphere Cloud Node.
  • the VM would run a batch script that ran javaws http://jenkins:9191/computer/vm-test-10x64c/salve-agent.jnlp. It would download it’s java script and bootstrap through it and once communications was running Jenkins would download our current tests from SVN and begin executing steps.

Now, move on to current: Jenkins 21.501 and JAVA 21 with OpenWebStart.

  • Jenkins would launch the vSphere Cloud Node.
  • the VM tries to execute the “new” script (the jnlp is listed above in an earlier response) but throws an error cannot read or execute the script. If I run the line http://jenkins:9191/computer/vm-test-10x64c/salve-agent.jnlp from a web browser command line, it DOES download the .jnlp. So I know I can GET to it.
    If I then manually run the .jnlp locally (not the go get it command) it fails with the same error message. I can’t RUN it.

Note: Although a message is displayed, I can’t find the logs. I’m assuming it is a OpenWebStart message?

How are the agents created? Are you using a cloud plugin that creates the VMs and adds them to Jenkins? IF yes which one?
When such an agent is defined in Jenkins which Launch Method does it use?

vsphere 2.2.7 plugin

<?xml version='1.1' encoding='UTF-8'?>
<org.jenkinsci.plugins.vSphereCloudSlave plugin="vsphere-cloud@2.27">
  <temporaryOfflineCause class="hudson.slaves.OfflineCause$UserCause">
    <timestamp>1747051894286</timestamp>
    <description>
      <holder>
        <owner>hudson.slaves.Messages</owner>
      </holder>
      <key>SlaveComputer.DisconnectedBy</key>
      <args>
        <string>anonymous</string>
        <string></string>
      </args>
    </description>
  </temporaryOfflineCause>
  <name>vm-test-10x64c</name>
  <description>Win10x64</description>
  <remoteFS>c:\Jenkins\</remoteFS>
  <numExecutors>1</numExecutors>
  <mode>NORMAL</mode>
  <retentionStrategy class="hudson.slaves.RetentionStrategy$Demand">
    <inDemandDelay>0</inDemandDelay>
    <idleDelay>5</idleDelay>
  </retentionStrategy>
  <launcher class="org.jenkinsci.plugins.vSphereCloudLauncher">
    <launcher class="hudson.slaves.JNLPLauncher">
      <workDirSettings>
        <disabled>false</disabled>
        <internalDir>remoting</internalDir>
        <failIfWorkDirIsMissing>false</failIfWorkDirIsMissing>
      </workDirSettings>
      <webSocket>false</webSocket>
    </launcher>
    <overrideLaunchSupported>true</overrideLaunchSupported>
    <vsDescription>QxSoft Test Cloud</vsDescription>
    <vmName>vm-test-10x64c</vmName>
    <waitForVMTools>true</waitForVMTools>
    <snapName>Running</snapName>
    <launchDelay>60</launchDelay>
    <idleAction>REVERT</idleAction>
    <LimitedTestRunCount>1</LimitedTestRunCount>
  </launcher>
  <label>Win10x64_Clean</label>
  <nodeProperties/>
  <vsDescription>QxSoft Test Cloud</vsDescription>
  <vmName>vm-test-10x64c</vmName>
  <snapName>Running</snapName>
  <waitForVMTools>true</waitForVMTools>
  <launchDelay>60</launchDelay>
  <idleOption>Shutdown and Revert</idleOption>
  <LimitedTestRunCount>1</LimitedTestRunCount>
</org.jenkinsci.plugins.vSphereCloudSlave>

Can’t help but feel I’m missing something REALLY stupid.

I DID update the “in use” plugins to current versions.

If it helps - here’s the error message.

Do you have the latest agent.jar in your VM?

Well, THAT is a good question. I ASSUME that is what it was trying to download. That might BE the stupid thing I’m missing here.

Do you follow vsphere-cloud-plugin/docs/vm-configuration.md at e725b5162cf055f439517e7c39ce530f70365447 · jenkinsci/vsphere-cloud-plugin · GitHub that has a link to a start batch file that includes downloading the agent.jar (or slave.jar)

As best as I can interpret.

Test cloud connect - success (under the cloud config)
Test VM connection in Node - success

So, I’m seeing all that.

The link you describe - the CLOUD is apparently config’d correctly. There is no link I can find to “create” a line for my batch which is trying to execute on the vm (javaws http://jenkins1:9191/computer/vm-test-10x64c/slave-agent.jnlp.

To me, this implies that the agent (agent-agent?) .jnlp is DOWNLOADED each run. I can download using that address, but it fails to parse. This also implies that the agent-agent.jnlp is being (or has been) created by Jekins on the host?

unless it is using the old .jnlp and THAT is what needs updated on the host. But THAT is not clear from the instructions either.

MAYBE important? Looking at the HOST logs I see this:

Agent “vm-test-10x64c” is connecting with the “-jnlpUrl” argument, which is deprecated. Use “-url” and “-name” instead

Not sure what “line” is creating the -jnlpUrl part of this. It’s not my startslave.bat

Complete log up to that point.

May 12, 2025 7:30:11 AM INFO org.jenkinsci.plugins.vSphereCloud InternalLog

[vm-test-10x64c] Starting Virtual Machine…

May 12, 2025 7:30:11 AM INFO org.jenkinsci.plugins.vSphereCloud InternalLog

[vm-test-10x64c] Reverting to snapshot:Running

May 12, 2025 7:30:16 AM INFO org.jenkinsci.plugins.vSphereCloud InternalLog

[vm-test-10x64c] Powering on VM

May 12, 2025 7:30:21 AM INFO org.jenkinsci.plugins.vSphereCloud InternalLog

[vm-test-10x64c] Waiting for VMTools

May 12, 2025 7:30:51 AM INFO org.jenkinsci.plugins.vSphereCloud InternalLog

[vm-test-10x64c] VM Tools are running

May 12, 2025 7:30:51 AM INFO org.jenkinsci.plugins.vSphereCloud InternalLog

[vm-test-10x64c] Finished wait for VMTools

May 12, 2025 7:30:51 AM INFO org.jenkinsci.plugins.vSphereCloud InternalLog

[vm-test-10x64c] Waiting for up to 60 seconds for agent to come online.

May 12, 2025 7:31:23 AM WARNING hudson.slaves.SlaveComputer doJenkinsAgentJnlp

Agent “vm-test-10x64c” is connecting with the “-jnlpUrl” argument, which is deprecated. Use “-url” and “-name” instead, potentially also passing in “-webSocket”, “-tunnel”, and/or work directory options as needed.

I know you aren’t OpenWebStart experts, but my OpenWebStrart config shows no JVM’s in the JVM manager. It doesn’t seem to find the Microsoft Open Java 21 instance.

Is there a better combination (since JAVA itself has deprecated javaws command) than the M$ OpenJava and OpenWebStart (which re-implements the javaws command)? This MAY be the problem?

finally figured out THEIR docs. Added M$ JVM and still same problem.

The OpenWebStart log shows that the download does indeed complete. That is then followed by the long error message I have sent which shows that “could not read or parse” and later - "MissingInformationException: No information element specified.

I would try to avoid using webstart at all.
The -jnlpUrl might be in the template for the cloud in Jenkins. Maybe you can post a screenshot of your cloud config, especially the part where the properties are set. And post your startslave.bat
Redact any information you don’t want us to see.

Here’s the cloud config…

StartSlave.bat is easy:

javaws http://jenkins1:9191/computer/vm-test-10x64c/slave-agent.jnlp

Note: We use OpenWebStart so the javaws will work since it is not longer available.

changed startslave.bat to a new “copy” of what it says to use:

curl.exe -sO http://vsrv-qxs-jenkins1:9191/jnlpJars/agent.jar
java -jar agent.jar -url http://vsrv-qxs-jenkins1:9191/ -secret 0fbb8304c23b14ce54d432fb0123425e4da3fcebdfefb95dc86a575b5f5821b5 -name “vm-qxs-win10x64c” -webSocket -workDir “c:\jenkins\remote”

curl runs.
java ends with “Error: Unable to access jarfile agent.jar”

Which goes back to - if there is supposed to be a static agent.jar file local, where does it come from and where do I put it? I ASSUMED that this command DOWNLOADED it and ran it?