0

We have a gradle project that has spring boot plugin. I'm trying to setup a remote debugger using Eclipse.

While setting up, I'm encountering Failed to connect to remote VM. Connection refused. I have tried some suggestions online and the issue still remains. I can't recall the commands I have run using gradle command.

Any suggestions on how to fix the issue? Can someone provide a detailed step on how to fix this?

It's really time consuming debugging using a logger.

Thank you in advance.

Irene
  • 21
  • 1
  • 1
  • 1
  • https://stackoverflow.com/a/40661369/2834978 – LMC Apr 21 '22 at 15:52
  • @LMC, on which directory should I run gradle bootRun --debug-jvmRun ? I have a gradle multi project. – Irene Apr 21 '22 at 16:20
  • I would say run the command as usual and add the `--debug-jvm` flag to it. – LMC Apr 21 '22 at 16:33
  • @LMC, I'm not actually running gradle bootRun via cmd. I'm running the application by going to gradle tasks tab in eclipse > application > right click bootRun > select Run gradle task. – Irene Apr 22 '22 at 02:59
  • I also tried to run the command in the root project but it's displaying Could not find method compile() for arguments [org.springframework.boot:spring-boot-starter-web] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependecyHandler. – Irene Apr 22 '22 at 03:02
  • I tried this: https://docs.spring.io/spring-boot/docs/1.5.21.RELEASE/reference/html/howto-build.html I tried jvmArgs but its displaying Debugger failed to attach: timeout during handshake – Irene Apr 22 '22 at 03:03
  • This works for me https://stackoverflow.com/a/49318329/2834978 – LMC Apr 22 '22 at 14:16

0 Answers0