eclipse 附加调试器(使用eclipse)播放框架失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17758564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Attach debugger (using eclipse) to play framework failed
提问by user2512057
I am using Scala to write a web on top of Play framework with eclipse IDE. I am trying to debug my app but hit debug attach failure. I tried to switch using Java instead of Scala,but I got same error. This is what I do.
我正在使用 Scala 在带有 Eclipse IDE 的 Play 框架之上编写一个 Web。我正在尝试调试我的应用程序,但遇到调试附加失败。我尝试使用 Java 而不是 Scala 进行切换,但我遇到了同样的错误。这就是我所做的。
- Create a project and run
play clean compile
- run
play debug run
- in Eclipse, set 'debug configration' ->remote java application -> host: localhost, port:9999 and common: debug
- in browser type in URL and enter: localhost:9999. Then get the following failure in play framework command line:
Debugger failed to attach: handshake failed - received
>GET / HTTP/1.1< - expected >JDWP-Handshake<
- 创建项目并运行
play clean compile
- 跑
play debug run
- 在 Eclipse 中,设置“调试配置” -> 远程 Java 应用程序 -> 主机:本地主机,端口:9999 和通用:调试
- 在浏览器中输入 URL 并输入:localhost:9999。然后在播放框架命令行中得到以下失败:Debugger failed to attach:handshake failed - received
>GET / HTTP/1.1< - expected >JDWP-Handshake<
Any idea what is wrong?
知道出了什么问题吗?
回答by estmatic
localhost:9999
is what Eclipse is going to use to communicate with your application. On your browser, you still access your application on localhost:9000
(default) or however you would access your application had you just done play run
.
localhost:9999
是 Eclipse 将用来与您的应用程序通信的东西。在您的浏览器上,您仍然可以在localhost:9000
(默认)上访问您的应用程序,或者您将访问您刚刚完成的应用程序play run
。
Basically, you've configured your debugging correctly in Eclipse.
基本上,您已经在 Eclipse 中正确配置了调试。
- Now, with your configuration selected from the Debug Configuration, click Debug(or selected your configuration from the Debug Astoolbar button). Eclipse will attach to
localhost:9999
. - Browse to
localhost:9000
like you normally would to access your application. - That's it. Eclipse will pause on any breakpoints you have set, etc.
- 现在,从Debug Configuration 中选择您的配置后,单击Debug(或从Debug As工具栏按钮中选择您的配置)。Eclipse 将附加到
localhost:9999
. - 浏览
localhost:9000
您通常会访问您的应用程序。 - 就是这样。Eclipse 将在您设置的任何断点等处暂停。