Debugging client in Linux

Hi all, I'm working on a JEE project with a Swing gui. Up until recently I was using Windows on my dev box but I've now switched to Linux for performance reasons. I've got the IntellIJ version of Linux working just fine, as well as everything else with one exception: debugging.

I've got 2 debuggers set up in IntelliJ, one for the server (WebLogic, using dt_socket transport) and one for the Swing client. In Windows, I setup the client debugger to use shared memory (dt_shmem) but since that option isn't available in Linux I've set it up to use socket as well.

The server debugger works great - it attaches to the port I've specified just fine. The client debugger, however, doesn't connect and fails with a "java.net.ConnectionException - Connection refused" error message. I'm using socket for the client, and picking a differnet port obviously than the one I'm using for the server debugger. I'm starting my Swing app using WebStart from a command-line. I've got a script which launches it and passes-in the necessary debug parameters:
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7004

However, the client debugger just never attaches. It seems very strange since the server debugger works just fine and it's using the same connection method. (dt_socket)

Any help or ideas would be greatly appreciated!!

2 comments

I suspect the problem is in the way you launch the client. Is it possible to start it directlyt with debug parameters (without
WebStart) and later attach to it with debugger?

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"



0

I am not sure if this is even helpful now. But I had the same problem I figured out what the issue is. it appears the whole parameter to -Djnlpx.vmargs is not getting passed to the JVM.

the value of this param is: Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7004

(as you mention). however, after the -Xdebug, the rest is ignored. The space is creating an issue. So do this:

pass the whole thing to the java command as follows:

$ java -Djnlpx.vmargs="Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7004" ... (and the rest of the parameter list...

hope this will help.

-Piyush

0

Please sign in to leave a comment.