user601144
user601144

Reputation: 101

Missing 'debug' command from Play 2.0 installed from Typesafe

I installed play 2.0 from the typesafe stack.

However, when i try to run sbt debug run it gives me the error:

[error] Not a valid key: debug (similar: idea)

Any suggestions on how to run a debug server?

Upvotes: 5

Views: 1474

Answers (2)

zinking
zinking

Reputation: 5695

I spent quite some time on this tonight. Hope my experience helps.

And as many of you I am encountering same issue that debug is not recognized under sbt. The easiest way of course is to follow the documentation. install the Play standalone and run the play debug run command, and then debug remote java application using the 9999 port.

but @Julienlafont 's solution did workout as well (I had the confusion at first as well). The key is to understand the whole process. Play web server is still served through port 9000. but port 9999 is opened as debug port to let IDE connect to , this is important.

I guess the reason why debug is not recognized is because it is not a sub command at all. it is indeed a couple of JVM arguments as @Julienlafont point out. so the what play command did is simply wrap the JVM argument for you. note once you enter the play console, the debug extension wont be recognized, because its essence is a couple of JVM arguments.

so go ahead set that JVM argument, once you see the hint , you are done with opening the debug port. run your server and finish the remaining part.

Upvotes: 0

Julien Lafont
Julien Lafont

Reputation: 7877

In order to debug with the sbt command instead of the play command, you have the option to set the env. variable SBT_OPTS with the classical
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999

Source : https://groups.google.com/forum/?hl=fr&fromgroups#!topic/play-framework/-RVlEh8S2F4

Upvotes: 8

Related Questions