0 Replies Latest reply: Apr 11, 2013 2:10 PM by 684777 RSS

    Unable to attach to target VM

    684777
      Hi,
      I am trying to executed jdb connect in Windows environment using following command C:\jdk1.6.0_33\bin>jdb -connect sun.jvm.hotspot.jdi.SAPIDAttachingConnector:pid=38156 and I am getting message below. I am running jdk 1.6 and java process I am trying to attach is a stand alone java application compiled with java 1.6 compiler running continuously.

      Executing command C:\jdk1.6.0_33\bin>jdb -listconnectors produce output below indicating that SAPIDAttachingConnector is supported.

      Connector: sun.jvm.hotspot.jdi.SAPIDAttachingConnector Transport: local proce
      ss
      description: This connector allows you to attach to a Java process using the
      Serviceability Agent

      Required Argument: pid (no default)
      description: PID of a Java process

      Why do I get error Fatal error: Unable to attach to target VM?

      java.io.IOException
      at sun.jvm.hotspot.jdi.SAPIDAttachingConnector.attach(SAPIDAttachingConn
      ector.java:126)
      at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnectio
      n.java:358)
      at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:1
      68)
      at com.sun.tools.example.debug.tty.Env.init(Env.java:64)
      at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1010)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.jvm.hotspot.jdi.SAPIDAttachingConnector.createVirtualMachine(SAPI
      DAttachingConnector.java:87)
      at sun.jvm.hotspot.jdi.SAPIDAttachingConnector.attach(SAPIDAttachingConn
      ector.java:111)
      ... 4 more
      Caused by: sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: WaitForEven
      t failed!
      at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach0(Native Me
      thod)
      at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach(WindbgDebu
      ggerLocal.java:152)
      at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:646)
      at sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(HotSpotAgent.java:598
      )
      at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:337)
      at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:314)
      at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:158)
      at sun.jvm.hotspot.jdi.VirtualMachineImpl.createVirtualMachineForPID(Vir
      tualMachineImpl.java:222)
      ... 10 more

      Fatal error:
      Unable to attach to target VM.

      thank you