Now resolved - see end of question.
I am attempting to debug a Java process with IntelliJ Community Edition's debugger. The socket is listening - but when I try to connect the debug process shows the following 'Connecting to the target VM, address: ':8003', transport: 'socket' It never makes the connection to the VM and I cannot debug.
I have moved to a Windows 7 64 bit PC - on my old XP machine and could connect and debug this Java process (it's an app I build and maintain).
It does not fail with the standard "Connection refused: Connect" error that you would get if no process was there to connect to. Netstat also shows the port is listening when the app is running.
TCP 0.0.0.0:8003 :0 LISTENING
Debug args for the app -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8003 -Xdebug
If I attempt to run the debug session from IntelliJ on a remote machine, I can connect to the process running on my local machine, and debug. If I run the Java app on a remote machine, and use IntelliJ on my local machine, I can debug. It is only if I run and debug on the same machine that it fails - unfortunately this is what I need to do almost all the time.
The only similar issues I have found are from 2004, to do with file paths with spaces, and were NetBeans, not IntelliJ. I have rebuilt and rerun my app ensuring no spaces or underscores in the path, no joy.
My intelliJ debug settings are to debug my local machine on socket, attach mode port 8003 - sorry as a new user I can't attach an image.
Other things I have attempted:
- Changing JRE versions
- Debugging using shared memory rather than socket transport
- I have not re-installed IntelliJ - I am using the same build as my fellow devs (10.5 IC 107-105) who don't have this problem.
- Changing the port the debugging process listens on (from 8003 to various other, unused according to netstat)
- I have tried using PC name, IP Address and 'localhost' to refer to the PC in the debug settings.
Stuck. Any help much appreciated.
Thanks
Steve
Resolved
Well, a day of failing to solve then I find the answer 20 mins after posting. An invalid JNI signature character, only picked up when debugging. Solved by adding this arg when debugging.
-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6547438
Thanks for the assistance. Still don't know why it would work when debugging remotely but not locally before.