Sven Viehmeier
Sven Viehmeier

Reputation: 418

sbt & Play 2.0 Debugging Information Missing

I am using sbt to build my Play 2.0 project. I managed to configure sbt to open a debugging port, attach an Eclipse remote debugger and enter a break point. I put the break point into one of my actions. But when the execution stops there, I cannot inspect any variable. I guess that sbt builds the Scala code without debugging information.

Does anybody know how to configure sbt to add debugging information? Or could it be a problem of my Scala IDE plugin for Eclipse or anything else?

Many thanks in advance!

Upvotes: 4

Views: 2043

Answers (4)

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

javacOptions ++= Seq("-g")

to the build.sbt file, solved the problem of missing debug information in the compiled classes.

Upvotes: 0

Nimrod007
Nimrod007

Reputation: 9913

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

in IntelliJ :

Go to "edit run configurations"

enter image description here

Create a new remote configuration (port 9999, all other details leave with default values)

enter image description here

Go back to IntelliJ and run the new debug configuration (don't forget to put a break point)

From command line run :

     sbt -jvm-debug 9999 run

Upvotes: 1

Sven Viehmeier
Sven Viehmeier

Reputation: 418

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

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

The problem that still remains is that I don't get the popups showing variable information when pointing the mouse cursor on a variable. But this seems to be a problem with the Scala IDE plugin and not with Play, because I get the variable information in the variables view in the debugging perspective.

Upvotes: 1

James Ward
James Ward

Reputation: 29433

To start Play in debug mode via sbt, run:

sbt -jvm-debug 9999 run

Upvotes: 4

Related Questions