在Eclipse中调试播放框架 [英] Debug Playframework in Eclipse

查看:110
本文介绍了在Eclipse中调试播放框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚从Netbeans转到Eclipse。在Netbeans中,我可以开箱调试Playframework应用程序。但是,在Eclipse中,为了调试网络应用程序(特定于Playframework应用程序),似乎很难配置。



和Play一样!文档,


主启动器只能用于运行为eclipse命令。然后,您可以使用
使用Debug As连接JPDA启动器随时启动
调试会话。停止调试会话不会
停止服务器。


但是,我看不到连接JPDA启动器在调试为(我使用Eclipse Classic 3.7.0)。
我搜索过JPDA(我是Java的新手,不知道主要启动器和JPDA,然后配置远程调试作为
http://javarevisited.blogspot.com/2011/02/how-to-setup- remote-debugging-in.html
但是它返回一个错误:


无法连接到远程VM。连接拒绝连接
拒绝:连接


我已经搜索并找到一些建议,如:


1.)编辑catalina.bat并添加行:set
JPDA_TRANSPORT = dt_socket ... set JPDA_ADDRESS = 8000 AND
2。 )编辑startup.bat调用%EXECUTABLE%jpda start%CMD_LINE_ARGS%


其实我不清楚这个,我猜它用于配置Tomcat。但是,我正在使用Play!默认服务器,检查了application.conf,并确定它正在侦听JPDA的端口9000和8000。



当然,我在调试之前启动了Play应用程序,我可以通过端口9000正常访问该应用程序。我正在使用Win 7,没有管理员权限。



你有一个关于调试播放的详细指南!在Eclipse中?

解决方案

首先,您已经使用播放创建了Eclipse的配置文件eclipsify YourProject 命令,对吧? (如果没有,请参阅播放框架文档以获取更多信息。)



之后,您的项目中应该有一个名为 eclipse 的文件夹。在其中,您应该看到命令将JDPA连接到YourProject.launch YourProject.launch 测试YourProject.launch



右键单击 YourProject.launch 并选择运行方式 - >您的项目从弹出菜单。这将启动您的应用程序。当应用程序运行时,右键单击将JDPA连接到YourProject.launch ,然后选择调试为 - >将JDPA从弹出菜单中连接到YourProject.launch 。这将启动您的应用程序的调试会话。


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?

解决方案

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.

这篇关于在Eclipse中调试播放框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆