Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the debugging in playframework in IntelliJ Idea

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 say a couple of words about debugging, but it is not clear - how can I perform the debugging? If I put a break-point, let's say in my Model's constructor class, then how and what I should launch to initialize debugging? I use IntelliJ Idea.

For example when I use Jboss, or Tomcat, there is an option in the IDE within those servers to run them in debug mode or "normal" mode. But how to work with Play Framework in this context? Should I configure remote debugging somehow?

like image 436
ses Avatar asked Mar 22 '11 11:03

ses


People also ask

How do I change the debugging port in IntelliJ?

Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Debugger. In the Built-in server area, specify the port where the built-in web server runs. By default this port is set to the default IntelliJ IDEA port 63342 through which IntelliJ IDEA accepts connections from services.

Why my debugger is not working in IntelliJ?

To solve this, simply remove the jar of the debugged module from all modules' dependencies in the Project Structure. If you do not know which modules have the debugged module jar as dependencies, you can use some tools (Eg. Sublime Text, bash, ...) to search for the module name which is stored in Intellij *.

How do I debug a script in IntelliJ?

Start debuggingOpen the HTML file that references the JavaScript to debug or select the HTML file in the Project tool window. From the context menu of the editor or the selection, choose Debug <HTML_file_name>. IntelliJ IDEA generates a debug configuration and starts a debugging session through it.


1 Answers

Most convenient way to run/debug applications in intellij IDEA is the following.

Menu command: Run -> Edit Configuration!

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:

configuration screen

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.

like image 172
wassertim Avatar answered Sep 18 '22 14:09

wassertim