Remote debugging Java Webstart application

  1. Download the xzy.jnlp file.
  2. Set the JAVAWS_VM_ARGS environment variable to
    -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8200 if the application runs with JDK 1.5 or lower
  3. From a console or cmd start the application with javaws xzy.jnlp or start with javaws -J”-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8200″ xyz.jnlp if you are using jdk 1.6
  4. Check that port 8200 is listening with netstat -an
    Netstat output
  5. Check your firewall settings.
  6. Define a new “Remote Java Applcation’ in Eclipse
  7. Set the IP and port.
  8. Start debugging.

(Source: Java forum & Trouble shooting and debugging guide)

Blogged with Flock

Advertisements
Explore posts in the same categories: Howto

4 Comments on “Remote debugging Java Webstart application”

  1. kumar Says:

    Thanks for posting. I followed the steps as mentioned for JWS Remote Debugging but still i get exception.

    “Failed to connect to Remote VM. connection refused”. What could be possible reason ? I am using Eclipse, JDK1.6.0_02. I made sure Port and IP is entered correctly

  2. Joe Says:

    Hi kumar!

    I realized that the theme of the blog cuts a part of the most important line of the post in some browsers… The longest line in the environment variable is: -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8200
    If you set it correctly and the problem still exists you should recheck that the debug port is opening after you start the webstart application on the client machine. (I added a screenshot to the post.) After that, try to connect from the “debugging” computer to the client machine with a simply telnet. If you are able to connect with telnet than we can be sure that there is no problem with the network connections and firewalls.
    Hope it helps.

    Joe

  3. fharper1961 Says:

    Hi Joe,

    I found that starting JWS from a shortcut icon worked just fine for debugging, once JAVAWS_VM_ARGS was set. For met it wasn’t necessary to explicitly start from cmd or a console.

    Frank

  4. Joe Says:

    Hi Frank,

    Thank you for your comment. (I almost forgot about this blog 🙂 )
    Your method is also fine but not in all cases. The troubleshooting guide (link is below the post) has the following note: “So when debugging, it is always best to download the jnlp file, and then launch javaws using that file as the arg.” (2.0) Special tip for all debugging.)
    In my case starting with the shortcut was not good. (SUN JDK 1.5_04)

    Joe


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: