在 Eclipse 中调试 Playframework [英] Debug Playframework in Eclipse

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

问题描述

我刚刚从 Netbeans 转移到 Eclipse.在 Netbeans 中,我可以开箱即用地调试 Playframework 应用程序.但是,在 Eclipse 中,为了调试网络应用(具体来说是 Playframework 应用)似乎很难配置它.

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).

在游戏中!文档,

主启动器只能与 Run As eclipse 命令一起使用.你然后可以使用连接 JPDA 启动器"使用调试为"启动一个随时调试会话.停止调试会话不会停止服务器.

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.

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

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.) 编辑 catalina.bat 并添加行:setJPDA_TRANSPORT=dt_socket ... 设置 JPDA_ADDRESS=8000 AND2.)编辑startup.bat call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

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%

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

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.

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

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.

你有详细的调试指南吗玩玩!在 Eclipse 中?

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

推荐答案

首先,您已经使用 play eclipsify YourProject 命令为 Eclipse 创建了配置文件,对吗?(如果没有,请参阅 Play 框架文档了解更多信息.)

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.)

之后,您的项目中应该有一个名为 eclipse 的文件夹.在其中,您应该看到命令 Connect JDPA to YourProject.launchYourProject.launchTest YourProject.launch.

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.

右键单击 YourProject.launch 并选择 Run As -->YourProject 从弹出菜单中.这将启动您的应用程序.当应用程序运行时,右键单击Connect JDPA to YourProject.launch,然后选择Debug As -->从弹出菜单中将 JDPA 连接到 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 中调试 Playframework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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