Sbt & Play 2.0 There is no debugging information

I use sbt to create my Play 2.0 project. I managed to configure sbt to open the debug port, connect the remote Eclipse debugger, and enter a breakpoint. I put a breakpoint in one of my actions. But when execution stops there, I cannot check any variable. I assume sbt is generating Scala code without debugging the information.

Does anyone know how to configure sbt to add debug information? Or could that be the problem of my Scala IDE plugin for Eclipse or something else?

Thank you very much in advance!

+4
source share
4 answers

To start playback in debug mode using sbt , run:

 sbt -jvm-debug 9999 run 
+4
source

I have not found a solution for all the problems that I have with debugging, but at least it works, so I can use it. Here is my status:

I use sbt directly and cannot use -jvm-debug 9999. But I added the following to JAVA_OPTS in the sbt script: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9999 This makes it possible to connect the remote Eclipse debugger and get debugging information (if the Play mode is in development mode).

The problem that still remains is that I do not get pop-ups displaying information about the variables when the mouse cursor moves over the variable. But this seems like a problem with the Scala IDE plugin, and not with Play, because I get variable information in the representation of variables in a debugging perspective.

+1
source

I found this the easiest solution: (using IntelliJ IDEA)

in IntelliJ:

Go to the "Edit Launch Settings" section.

enter image description here

Create a new remote configuration (port 9999, all other data will remain with default values)

enter image description here

Go back to IntelliJ and start the new debug configuration (don't forget to set a breakpoint)

From the command line:

  sbt -jvm-debug 9999 run 
+1
source

I had the same problem in a sbt modular build. Adding

 javacOptions ++= Seq("-g") 

to the build.sbt file, the problem of lack of debugging information in compiled classes has been resolved.

0
source

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


All Articles