Debug Playframework 2.0 in Eclipse
Asked Answered
O

5

11

There's no eclipse folder in project folder after 'play eclipsify'. How to debug this project use eclipse with JPDA?

O answered 19/3, 2012 at 22:23 Comment(2)
Have you tried refreshing your project in Eclipse (right-click on the project and then just click on the refresh menu)? Sorry, I have never tried it but it looks like it may just be it.Outmost
Yes, but the problem is that I don't know how to connect to JPDA in eclipse to connect to the server. In 1.24 playframework, there is a debug launcher file in the project after "eclipsify".Thanks anywayO
O
25

Since play 2.0, only thing need to do to debug a project is run project in console 'play debug run' and create a new debug conf of remote java application with port 9999

O answered 20/3, 2012 at 8:48 Comment(4)
Can you please be more specific?Embroil
run your play project in command line with "play debug run". If that run correctly, you could access the "127.0.0.1:9000" in browser. After that, create a debug configuration in eclipse with right click your project-debug as-debug configurations-"double click"Remote Java Application-change host and port to localhost and 9999(make sure you select the right project). Then click debug to start debugging and place breakpoints as you wish.O
not working on windows. play debug run can start app on port 9000. VM connection timeout when try to connect debug as .Twum
try to change debug host from 127.0.0.1 to localhost?O
H
13

Exactly as fxp has said, in play 2.2.x you should do the following:

  1. Type in the play console play debug run
  2. In eclipse, right click over your project and go to Debug As, and then click on Debug configurations..
  3. In Debug configurations screen, go and click to Remote Java Application.
  4. Put 9999 in the port input text (*)

(*): when you execute play debug run, look the print information for the port number. Probably the first message will be

Listening for transport dt_socket at address: 9999

Haemostatic answered 28/11, 2012 at 21:11 Comment(0)
F
3

In Play 2.3.x, you need to start the application with:

activator -jvm-debug 9999 run

Then follow all the other steps in the other answers.

Setting up your preferred IDE

Flipflop answered 30/3, 2015 at 22:19 Comment(0)
J
0

The socket port for debugging is 9999 in play 2.0

Jackquelinejackrabbit answered 25/5, 2012 at 16:49 Comment(1)
Also can be set with "set JPDA_PORT=xxxx" if you want to set up multiple JPDA port on one machineO
S
0

Another thing, you might need to create a unit test in Play to get the debug running.

Siegfried answered 10/1, 2013 at 17:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.