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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:55:04  来源:igfitidea点击:

Attach debugger (using eclipse) to play framework failed

javaeclipsedebuggingplayframeworkplayframework-2.0

提问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 进行切换,但我遇到了同样的错误。这就是我所做的。

  1. Create a project and run play clean compile
  2. run play debug run
  3. in Eclipse, set 'debug configration' ->remote java application -> host: localhost, port:9999 and common: debug
  4. 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<
  1. 创建项目并运行 play clean compile
  2. play debug run
  3. 在 Eclipse 中,设置“调试配置” -> 远程 Java 应用程序 -> 主机:本地主机,端口:9999 和通用:调试
  4. 在浏览器中输入 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:9999is 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 中正确配置了调试。

  1. 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.
  2. Browse to localhost:9000like you normally would to access your application.
  3. That's it. Eclipse will pause on any breakpoints you have set, etc.
  1. 现在,从Debug Configuration 中选择您的配置后,单击Debug(或从Debug As工具栏按钮中选择您的配置)。Eclipse 将附加到localhost:9999.
  2. 浏览localhost:9000您通常会访问您的应用程序。
  3. 就是这样。Eclipse 将在您设置的任何断点等处暂停。