Trace
Trace

Reputation: 18889

Lagom debugger Intellij

I can't get the debugger to work. Steps to reproduce:

1) sbt lagom:runAll

enter image description here

2) sbt -jvm-debug 5005

enter image description here

3) Set remote config in Intellij + start debugging

enter image description here

enter image description here

4) Set breakpoints

enter image description here

5) Make request

enter image description here

The debugger doesn't stop at the breakpoints.
What is the problem here?

Upvotes: 5

Views: 1270

Answers (2)

kasopey
kasopey

Reputation: 375

@Ruslan Stelmachenko as @Tim Moore said - just execute:

mvnDebug lagom:runAll

and maven will tell you on what port is it listening to connect with remote debug connection and will nicely wait for this connection:

enter image description here

Upvotes: 0

Tim Moore
Tim Moore

Reputation: 9482

You need to use the -jvm-debug flag on the sbt runAll command, like this:

sbt -jvm-debug 5005 runAll

The following steps in your list are correct.

When you run sbt runAll and sbt -jvm-debug 5005 as separate commands, you are creating two separate sbt sessions: one that runs your services, and the other is doing nothing but waiting for input at the prompt. When you connect your debugger, it is connecting to the second, idle session, instead of the one that is running your services.

Upvotes: 5

Related Questions