Here we have a link
http://www.playframework.org/documentation/1.0.1/ide
about how to configure playframework to be working with different IDEs. There they
when you launch Play Framework (via play run) you will see that is says that the debug port is running at a certain address. This is a standard Java behavior on servers (having a debug port enabled).
Most IDEs allow you to set up a connection to that remote port so you can debug the code remotely. The specific steps will depend on the IDE you are using, but it should be as simple as that.
I had a similar problem.
play (cloned from github at 2011-08-28) and intellij 10.5
SEVERE: Cannot read application.conf
my fix was: -Dapplication.path=. (without "")
to set -Djavaagent=... was no longer necessary on my box.
Most convenient way to run/debug applications in intellij IDEA is the following.
Menu command: Run -> Edit Configuration!
Add new configuration -> Application
Then fill up the fields:
Main class:
play.server.Server
VM Parameters:
-Dapplication.path=.
You should have something similar:
If you did it correctly, then you can run and stop your app right from IDE
EDIT for Play! 2
Play 2 has good documentation for debugging. So go read it. But if you want to investigate run/debug buttons method - read further.
It is different for Play 2.
Settings:
Main class:
play.core.server.NettyServer or play.core.server.ProdServerStart
VM Parameters:
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999 -Dapplication.path=.
You still can debug your application by pressing debug button but I have not figured out some issues:
It always starts in PROD mode, so you can't make hot code changes.
RUNNING_PID. There is an error when you restart your debugging session saying that you have to delete this file.
If its a play project, from the command line :
play debug
If its a SBT play project from the command line :
sbt -jvm-debug 9999 run
debug port is 9999 by default
now create a remote configuration
in IntelliJ :
Go to "edit run configurations"
Create a new remote configuration (port 9999, all other details leave with default values)
run the new debug configuration (don't forget to put a break point)
In Play 2, simply do the following:
play debug
run
and hit enter.Since version 11 of IDEA, there is native support for the Play framework in the ultimate edition. To debug your Play application do the following:
You should now hit the breakpoint.