# Javaws fails to run on agent

**URL:** <https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920>\
**Category:** Using Jenkins\
**Created:** [May 8, 2025, 6:13pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920 "2025-05-08T18:13:05Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [May 12, 2025, 5:41pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/21 "2025-05-12T17:41:18Z")

</div>

the jar must be provided either as part of the image or by downloading it at agent start (the latter is better as it ensures that you always use a jar that is working with the Jenkins version you want to connect to).  
Don’t know why your java thinks the agent jar is not accessible. Some hints what could be wrong: [https://stackoverflow.com/questions/11943948/what-causes-unable-to-access-jarfile-error](https://stackoverflow.com/questions/11943948/what-causes-unable-to-access-jarfile-error)

---

<div class="post-metadata">

**Author:** ![jp1955](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jp1955](https://community.jenkins.io/u/jp1955)\
**Post date:** [May 12, 2025, 6:14pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/22 "2025-05-12T18:14:34Z")

</div>

Mostly success!

Two “typos” that chain through the system making finding the root an issue.

My Jenkins URL (in Jenkins) was mistyped. Which created a problem with the “address” in the curl and java. I found it by manually doing the curl with a -v as I wanted to see where the agent was stored. Well… it wasn’t. 🙂 it is now.

I also had a mismatch in my remote/remoting directory on the agent. It appears that somewhere along the line the name was changed or – mistyped somewhere.

In any case, the system starts. I am now at a point where I get (from hudson):

Warning: Did not receive X-Remoting-Capability header (hudson remoting launcher)  
and  
INFO: Failed to connect: Handshake error. (hudson remoting engine)

---

<div class="post-metadata">

**Author:** ![jp1955](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jp1955](https://community.jenkins.io/u/jp1955)\
**Post date:** [May 12, 2025, 6:44pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/23 "2025-05-12T18:44:12Z")

</div>

The agent remoting log contents:

May 12, 2025 2:36:06 PM hudson.remoting.Launcher createEngine  
INFO: Setting up agent: Test  
May 12, 2025 2:36:06 PM hudson.remoting.Engine startEngine  
INFO: Using Remoting version: 3301.v4363ddcca\_4e7  
May 12, 2025 2:36:06 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir  
INFO: Using c:\jenkins\remoting as a remoting work directory  
May 12, 2025 2:36:07 PM hudson.remoting.Engine$1HeaderHandler afterResponse  
WARNING: Did not receive X-Remoting-Capability header  
May 12, 2025 2:36:07 PM hudson.remoting.Launcher$CuiListener status  
INFO: Failed to connect: Handshake error.  
May 12, 2025 2:36:07 PM hudson.remoting.Launcher$CuiListener status  
INFO: Waiting 1 second before retry  
May 12, 2025 2:36:08 PM hudson.remoting.Engine$1HeaderHandler afterResponse  
WARNING: Did not receive X-Remoting-Capability header  
May 12, 2025 2:36:08 PM hudson.remoting.Launcher$CuiListener status  
INFO: Failed to connect: Handshake error.  
May 12, 2025 2:36:08 PM hudson.remoting.Launcher$CuiListener status  
INFO: Waiting 3 seconds before retry  
May 12, 2025 2:36:11 PM hudson.remoting.Engine$1HeaderHandler afterResponse  
WARNING: Did not receive X-Remoting-Capability header  
May 12, 2025 2:36:11 PM hudson.remoting.Launcher$CuiListener status  
INFO: Failed to connect: Handshake error.  
May 12, 2025 2:36:11 PM hudson.remoting.Launcher$CuiListener status  
INFO: Waiting 7 seconds before retry  
May 12, 2025 2:36:18 PM hudson.remoting.Engine$1HeaderHandler afterResponse  
WARNING: Did not receive X-Remoting-Capability header  
May 12, 2025 2:36:18 PM hudson.remoting.Launcher$CuiListener status  
INFO: Failed to connect: Handshake error.  
May 12, 2025 2:36:18 PM hudson.remoting.Launcher$CuiListener status  
INFO: Waiting 10 seconds before retry

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [May 12, 2025, 6:52pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/24 "2025-05-12T18:52:47Z")

</div>

Do you have a reverse proxy? Maybe it prevents that you can use websocket.  
Try to remove the `-webSocket`

---

<div class="post-metadata">

**Author:** ![jp1955](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jp1955](https://community.jenkins.io/u/jp1955)\
**Post date:** [May 12, 2025, 7:22pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/25 "2025-05-12T19:22:05Z")

</div>

Well, it changed the message:

Could not locate server [[http://jenkins1:9191/](http://jenkins1:9191/)]  
[http://jenkins1:9191/tcpslaveagent](http://jenkins1:9191/tcpslaveagent) listener/ is invalid: 404 Not Found

Don’t think it liked that one.

The hudson stuff is well down into areas I haven’t a clue about.

---

<div class="post-metadata">

**Author:** ![jp1955](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jp1955](https://community.jenkins.io/u/jp1955)\
**Post date:** [May 12, 2025, 8:23pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/26 "2025-05-12T20:23:50Z")

</div>

Well, that’s progress, I think.

Used the SERVER logs and it said something like name TEST not found. Looked at my java on the agent and it was indeed incorrect. Fixed it.

Now I get a message “wrong secret for vm-test-10x64c”. _ **Remember - I am using vSphere CLOUD, NOT the permanent agent.** _ Do I NEED “secret” in this case?

My current fixed .bat on the agent:  
curl.exe -sO [http://vsrv-qxs-jenkins1:9191/jnlpJars/agent.jar](http://vsrv-qxs-jenkins1:9191/jnlpJars/agent.jar)  
java -jar agent.jar -url [http://vsrv-qxs-jenkins1:9191/](http://vsrv-qxs-jenkins1:9191/) -secret 0fbb8304c23b14ce54d432fb0123425e4da3fcebdfefb95dc86a575b5f5821b5 -name “vm-qxs-win10x64c” -webSocket -workDir “c:\jenkins”

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [May 12, 2025, 8:32pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/27 "2025-05-12T20:32:28Z")

</div>

The secret is required. I guess you get an environment variable set that contains the secret.

---

<div class="post-metadata">

**Author:** ![jp1955](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jp1955](https://community.jenkins.io/u/jp1955)\
**Post date:** [May 13, 2025, 1:39pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/28 "2025-05-13T13:39:57Z")

</div>

How do I recreate that info for this agent? If I have a non-vsphere agent and it is offline, I get a screen full of the curl/java cut and paste. For vsphere cloud agents I do not get a page of script to copy (including the secret)

I suspect this may be the last issue here.

---

<div class="post-metadata">

**Author:** ![jp1955](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jp1955](https://community.jenkins.io/u/jp1955)\
**Post date:** [May 13, 2025, 2:15pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/29 "2025-05-13T14:15:38Z")

</div>

Found a script to list the secrets. Replaced and it is now running.  
Thanks.

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [May 13, 2025, 3:56pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/30 "2025-05-13T15:56:35Z")

</div>

As it is a cloud agent the same image can be used to start multiple agents. So it doesn’t make sense hard code the Jenkins url, the agent name and the agent secret in your start script.  
I would assume that the vsphere plugin is calling your start script and that it sets certain environment variables that contain all that information.

---

<div class="post-metadata">

**Author:** ![davmano](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/davmano/32/14810_2.png) [@davmano](https://community.jenkins.io/u/davmano)\
**Post date:** [May 13, 2025, 4:02pm UTC](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920/31 "2025-05-13T16:02:51Z")

</div>

Hi, John

If you still need Help, here is what I think you should do.  
The `javaws` command is deprecated since Java 11, and OpenWebStart struggles with the JNLP file post-upgrade to 2.504. To resolve:

1. Use the modern method: Download `agent.jar` from `http://jenkins1:9191/jnlpJars/agent.jar`, then run:

```auto
java -jar agent.jar -jnlpUrl http://jenkins1:9191/computer/vm-test-10x64c/slave-agent.jnlp

```

2. Confirm Java 21 is used (`java -version`).
3. Ensure the JNLP URL is accessible (test with a browser).

This should fix the issue. If not, share the agent logs for more help!

Best,  
David Mano

[Previous page](https://community.jenkins.io/t/javaws-fails-to-run-on-agent/30920.md?page=1)
