简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM