I am having trouble trying to get rid of this exception. I wrote a program to attach the debugger to a remote server using "com.sun.jdi.SocketAttach" as the attaching connector and once connection is made, I added a debug Target.
vm = connector.attach(map)
debugTarget = JDIDebugModel.newDebugTarget(launch, remoteVM, name, null, false, true, true)
launch.addDebugTarget()
My code is working fine but I get this exception everytime i close my eclipse workspace which has an active debug connection to the server. Looks like this:
!ENTRY org.eclipse.jdt.debug 4 125 2014-05-28 11:20:22.562
!MESSAGE Internal error logged from JDI Debug:
!STACK 0
com.sun.jdi.VMDisconnectedException: Got IOException from Virtual Machine
at org.eclipse.jdi.internal.connect.PacketSendManager.sendPacket(PacketSendManager.java:89)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:186)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226)
at org.eclipse.jdi.internal.request.EventRequestImpl.disable(EventRequestImpl.java:217)
at org.eclipse.jdi.internal.request.EventRequestManagerImpl.deleteEventRequest(EventRequestManagerImpl.java:367)
at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.removeRequests(JavaBreakpoint.java:769)
at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.removeFromTarget(JavaBreakpoint.java:716)
at org.eclipse.jdt.internal.debug.core.breakpoints.JavaLineBreakpoint.removeFromTarget(JavaLineBreakpoint.java:187)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.removeAllBreakpoints(JDIDebugTarget.java:1566)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.cleanup(JDIDebugTarget.java:1522)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.shutdown(JDIDebugTarget.java:1658)
at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin.stop(JDIDebugPlugin.java:345)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:771)
at java.security.AccessController.doPrivileged(AccessController.java:330)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:764)
at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:510)
Upon investigating the issue, I found this exception is thrown when the client sends request to VM even after the VM is disconnected. But in my case, I did not had any applications deployed on the server and I was not debugging any application and still after closing the workspace, I get this exception.
I tried to implement DebugEventListener but not sure if am on the right track. Please advise if you know how to get over this issue.
Thanks