dansomething / coc-java-debug

An extension for coc.nvim to enable Java debugging via jdt.ls
https://www.npmjs.com/package/coc-java-debug
Eclipse Public License 2.0
100 stars 8 forks source link

Failed to attach to remote debugee VM #12

Closed fedoranvar closed 2 years ago

fedoranvar commented 3 years ago

Good day to you!

After :CocCommand java.debug.vimspector.start received connection refused:

image

.gadgets.json: image

.vimspector.json: image

netstat -lnpt: image

Any help would be great!

Thanks!

dansomething commented 3 years ago

Failed to attach to remote debuggee VM. is a message I'd expect to see if there is no JVM process waiting for a debugger to attach to on the specific port under configurations. It looks like you have the attach port set to 9000.

In your netstat output I don't see any Java process on port 9000. Did you start a Java process with the debug flags set? Here's a simplified example from the readme. The example uses port 5005, but you can change it to 9000 to match your config.

fedoranvar commented 3 years ago

@dansomething, you're right!

Indeed, recently for some reasons i've changed port 9000 to 9001 - now it's all working,

Good day to you!

nilm987521 commented 2 years ago

the same issue "Failed to attach to remote debugee VM #12" but I didn't change port 5005....How can I fix it?

dansomething commented 2 years ago

@nilm987521 have you confirmed the Java process you want to debug is waiting for a connection on port 5005? Did you set the port to 5005 in your .vimspector.json file?

nilm987521 commented 2 years ago

@dansomething this is my .vimspector.json under project folder,

  "adapters": {
    "java-debug-server": {
      "name": "vscode-java",
      "port": "${AdapterPort}"
    }
  },
  "configurations": {
    "Java Attach": {
      "default": true,
      "adapter": "java-debug-server",
      "configuration": {
        "request": "attach",
        "host": "127.0.0.1",
        "port": "5005"
      },
      "breakpoints": {
        "exception": {
          "caught": "N",
          "uncaught": "N"
        }
      }
    }
  }
}
dansomething commented 2 years ago

What about the Java process? Is it waiting for a connection on port 5005? Also, are you running the latest versions of coc-java and eclipse.jdt.ls?

Without more information, it will be difficult to troubleshoot the issue. Providing the following may help: Versions of relevant software

Relevant logs and error messages

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed due to lack of activity.