IntelliJ Remote Debugger Connects But Breakpoints Don't Work

I am trying the Scala Scalatra web framework. According to the documentation here , the steps to enable IntelliJ debugging are:

  1. Add the usual JDK options for remote debugging: "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
  2. Create a “Remote” Startup Configuration in Intellij
  3. Run sbt, run sbt jetty:start, and then run the remote debugger.

When I do this, the SBT prints out:

Listening for transport dt_socket at address: 5005

And IntelliJ prints:

Connected to the target VM, address: 'localhost:5005', transport: 'socket'

However, breakpoints do not seem to work. When I click on the following endpoint with a breakpoint at *:

class AppServlet extends AppStack {
  get("/break-test") {
*   val response = "DONE"
    response
  }
}

The code does not stop at this line, but continues, so I get the answer DONE. "

I am using Java 1.8.0_111, Scala 2.12 and SBT 0.13.15.

+5
3

, :

-agentlib:. JDWP = = , = , = , s = 5005

, , -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005, For JDK 1.4.x.

+2

SBT -jvm-debug, SBT, : . , var debugPort build.sbt(.settings(debugPort in Jetty := 5005)) SBT (set debugPort in Jetty := 5005), jetty:debug ( , xsbt-web-plugin).

0

, "xsbt-web-plugin".

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.2")

set debugPort in Jetty := 5005 set debugPort in Jetty := 5005 jetty:debug

localhost:5005 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

Java 1.8, Scala 2.12.6, Scalatra 2.6.5, sbt 1.2.8.

I would really appreciate it if someone could give a more or less accurate configuration that was tested.

If it takes me too much time to get this to work, then I will probably continue to work without a debugger, which of course I would rather not do.

Thank!

0
source

Source: https://habr.com/ru/post/1678083/


All Articles