Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
267 views
in Technique[技术] by (71.8m points)

debugging - Debug Playframework in Eclipse

I just moved from Netbeans to Eclipse. In Netbeans, I can debug Playframework applications out of the box. However, in Eclipse, it seems hard to configure this in order to debug a web app (a Playframework app in specific).

As in Play! documentation,

The main launcher in only usable with the Run As eclipse command. You can then use the “Connect JPDA launcher” using “Debug As” to start a debugging session at any time. Stopping the debugging session will not stop the server.

However, I can not see “Connect JPDA launcher” in "Debug As" (I'm using Eclipse Classic 3.7.0). I've searched about JPDA (I'm new to Java and don't know about "main launcher" and JPDA, then config Remote Debug as instruct in http://javarevisited.blogspot.com/2011/02/how-to-setup-remote-debugging-in.html But it's returning an error:

Failed to connect to remote VM. Connection refused. Connection refused: connect

I've searched and found some suggestions like:

1.)editing catalina.bat and adding the lines : set JPDA_TRANSPORT=dt_socket ... set JPDA_ADDRESS=8000 AND 2.)Editing startup.bat call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

Actually I don't clearly understand this and I guess it's for configuring Tomcat. However, I'm using Play! default server, checked the application.conf and sure that it's listening to port 9000 and 8000 for JPDA.

Of course, I have started the Play app before debugging, I can access the app via port 9000 normally. I'm using Win 7 with no admin rights.

Do you have a detailed guide on debugging Play! in Eclipse?

question from:https://stackoverflow.com/questions/7172013/debug-playframework-in-eclipse

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

First of all, you have created the configuration files for Eclipse by using the play eclipsify YourProject command, right? (If not, see Play framework documentation for more information.)

After that, you should have a folder named eclipse in your project. In it, you should see commands Connect JDPA to YourProject.launch, YourProject.launch and Test YourProject.launch.

Right-click on the YourProject.launch and choose Run As --> YourProject from the pop-up menu. That will start your application. When the application is running, right-click on the Connect JDPA to YourProject.launch, and choose Debug As --> Connect JDPA to YourProject.launch from the pop-up menu. That will start a debug session on your application.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...