【问题标题】:Can not debug play framework 2.6.x java无法调试play framework 2.6.x java
【发布时间】:2018-12-06 15:50:20
【问题描述】:

我是 Play 新手,我安装了 playframework 2.6。我以前可以调试项目,但现在不能。我尝试了很多项目,但我无法调试。

当我发出命令 sbt run 时,就没有问题了:

--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

但是当我发出命令sbt -jvm-debug 9999时,控制台的输出如下:

Listening for transport dt_socket at address: 9999
[info] Loading settings for project play-new-build from plugins.sbt,scaffold.sbt ...
[info] Loading project definition from /home/erlendurag/projects/play-new/project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to play-new (in build file:/home/erlendurag/projects/play-new/)
[info] sbt server started at local:///home/erlendurag/.sbt/1.0/server/80df831136abccd57227/sock
[play-new] $ 

但是 AkkaHttpServer 没有启动?通过使用 netstat 命令,我看到 java 正在侦听端口。但是如果我打开 localhost:9000 什么都没有。

【问题讨论】:

    标签: playframework-2.6


    【解决方案1】:

    在使用 SBT 控制台的文档中https://www.playframework.com/documentation/2.6.x/PlayConsole

    有这行代码:

    您可以在启动控制台时要求 Play 启动 JPDA 调试端口。你可以 然后使用 Java 调试器连接。使用 sbt -jvm-debug 命令来做 那:

    $ sbt -jvm-debug 9999

    但如果我也想运行 AkkaHttpServer,那么正确的命令是:

    sbt run -jvm-debug 9999
    

    这让我很困惑!

    但在这些 Play Framework 教程中给了我答案。

    sbt run -jvm-debug 9999
    

    https://www.youtube.com/playlist?list=PLYPFxrXyK0Bx9SBkNhJr1e2-NlIq4E7ED

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多