Eclipse Remote Debugging: Failed to connect to remote virtual machine

I am trying to remotely debug an application. When setting up, I provide a standard ( Socket Attach ) connection type.

After I debug it, I got the 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 could be the reason?

+4
source share
1 answer

I had a similar problem when I needed to debug an OSGI server.

A combination of problems appeared, and after solving them, I could debug well.

I answered this in this thread

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

service iptables stop

, . , , - , JDebugTool, , Eclipse.

Ant, , javac :

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

Eclipse , :

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

+1

Source: https://habr.com/ru/post/1543984/


All Articles