How can I debug applications under Java Web Start (JNLP)?

前端 未结 9 2299
你的背包
你的背包 2020-11-29 02:29

I know how I can debug a remote Java VM with Eclipse, but how can I do it with a Java Web Start program. I have a problem that only occurs in Java Web Start. It must be secu

9条回答
  •  心在旅途
    2020-11-29 03:18

    You will need to do the following:

    1. Enable the Java logs and tracing in the Java Control Panel > Advanced.

    2. Enable parameters for debugging Java (optional but useful i.e. problems with tls/ssl handshake as close_notify or handshake_failure) & launching the JNLP, there are two ways you can do it:

      2.a. Download the JNLP file and execute it from command line (the SET command is not required in this particular case).

      set JAVA_TOOL_OPTIONS=-Djavax.net.debug=all
      javaws -wait jnlp.jnlp
      

      2.b. Add arguments (i.e. -Djavax.net.debug=all) for the JVM in the Java Control Panel > Java > View (this is not required in this particular), and launch the JNLP file from browser:

    3. The logs and traces are located in the log directory from the Java Deployment Home from where I paste these locations:

      a. Windows XP: %HOME%\Application Data\Sun\Java\Deployment

      b. Windows 7/Vista: %APPDATA%\..\LocalLow\Sun\Java\Deployment

      c. Linux/Solaris: %HOME%/.java/deployment

    With javax.net.debug=all you will see the handshake if the jar inside the jnlp is loaded from an https connection. This kind of problems are hard to debug.

    ...
    %% No cached client session
    *** ClientHello, TLSv1.2
    ...
    ***
    ... 
    Java Web Start Main Thread, received EOFException: error
    Java Web Start Main Thread, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    Java Web Start Main Thread, SEND TLSv1.2 ALERT:  fatal, description = handshake_failure
    Java Web Start Main Thread, WRITE: TLSv1.2 Alert, length = 2
    Java Web Start Main Thread, called closeSocket()
    #### Java Web Start Error:
    

提交回复
热议问题