Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote Debugging Eclipse : Failed to connect to remote VM

I am trying to debug an application remotely. While configuring i am giving Standard(Socket Attach) Connection type.

After when I debug it I got following exception.

com.sun.jdi.connect.spi.ClosedConnectionException
at org.eclipse.jdi.internal.connect.SocketTransportService.readHandshake(SocketTransportService.java:209)
at org.eclipse.jdi.internal.connect.SocketTransportService.access$7(SocketTransportService.java:201)
at org.eclipse.jdi.internal.connect.SocketTransportService$3.run(SocketTransportService.java:172)
at java.lang.Thread.run(Unknown Source)

What can be the possible reason of it?

like image 372
Rajan Avatar asked Nov 10 '22 06:11

Rajan


1 Answers

I had a similar issue when I needed to debug in on OSGI server.

There were a combination of trouble and after solving them I could debug well.

I answered it in this thread

By the way, you can try by stopping your firewall, in case of iptables you have to do:

service iptables stop

You can try by modifying your debugging port and trying to access it. Another test you can do is to debug with another tool like JDebugTool to check if you Eclipse is the problem.

If you use Ant, verify you have your javac configured well:

<javac srcdir="..." destdir="..." classpathref="..." debug="true" debuglevel="lines,vars,source" />

In Eclipse verify you have this:

windows > preferences > Java > compiler -> "Classfile generation" -> check "Add line number attributes to generated class file"

Hope to help

like image 194
Federico Piazza Avatar answered Nov 15 '22 05:11

Federico Piazza