eclipse - 调试不适用于 play 框架激活器、scala 和 eclipse

标签 eclipse scala debugging playframework playframework-2.3

有很多关于此的帖子,说明很简单,但在我的一生中,我无法让调试器在断点处停止。

我的环境是

  • eclipse 4.4.1
  • 斯卡拉 2.11
  • Scala IDE 4.1.0.nightly
  • Play Framework 2.3.3
  • 在 Scala IDE 0.4.6 中 Play 支持

  • 我按如下方式启动激活器
    activator -jvm-debug 9999 run
    

    我已经设置了一个带有标准套接字连接的远程 Java 应用程序调试配置。调试配置运行,附加到远程并启动一堆 sbt 线程。

    但是,它不会在调试器中停止!看起来并不难,我做错了什么?

    编辑:
    我在一个我已经工作了一段时间的项目和一个全新的、未受影响的 play-anguale-require-seed 项目实例中遇到了这个问题。这是该项目的 build.sbt:
    import WebKeys._
    
    // TODO Replace with your project's/module's name
    name := """play-angular-require-seed"""
    
    // TODO Set your organization here; ThisBuild means it will apply to all sub-    modules
    organization in ThisBuild := "your.organization"
    
    // TODO Set your version here
    version := "2.3.7-SNAPSHOT"
    
    // Scala Version, Play supports both 2.10 and 2.11
    //scalaVersion := "2.10.4"
    scalaVersion := "2.11.4"
    
    lazy val root = (project in file(".")).enablePlugins(PlayScala)
    
    // Dependencies
    libraryDependencies ++= Seq(
      filters,
      cache,
      // WebJars (i.e. client-side) dependencies
      "org.webjars" % "requirejs" % "2.1.14-1",
      "org.webjars" % "underscorejs" % "1.6.0-3",
      "org.webjars" % "jquery" % "1.11.1",
      "org.webjars" % "bootstrap" % "3.1.1-2" exclude("org.webjars", "jquery"),
      "org.webjars" % "angularjs" % "1.2.18" exclude("org.webjars", "jquery")
    )
    
    // Scala Compiler Options
    scalacOptions in ThisBuild ++= Seq(
      "-target:jvm-1.7",
      "-encoding", "UTF-8",
      "-deprecation", // warning and location for usages of deprecated APIs
      "-feature", // warning and location for usages of features that should be                 imported explicitly
      "-unchecked", // additional warnings where generated code depends on assumptions
      "-Xlint", // recommended additional warnings
      "-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver
      "-Ywarn-value-discard", // Warn when non-Unit expression results are unused
      "-Ywarn-inaccessible",
      "-Ywarn-dead-code"
    )
    
    //
    // sbt-web configuration
    // https://github.com/sbt/sbt-web
    //
    
    // Configure the steps of the asset pipeline (used in stage and dist tasks)
    // rjs = RequireJS, uglifies, shrinks to one file, replaces WebJars with CDN
    // digest = Adds hash to filename
    // gzip = Zips all assets, Asset controller serves them automatically when client accepts them
    pipelineStages := Seq(rjs, digest, gzip)
    
    // RequireJS with sbt-rjs (https://github.com/sbt/sbt-rjs#sbt-rjs)
    // ~~~
    RjsKeys.paths += ("jsRoutes" -> ("/jsroutes" -> "empty:"))
    
    //RjsKeys.mainModule := "main"
    
    // Asset hashing with sbt-digest (https://github.com/sbt/sbt-digest)
    // ~~~
    // md5 | sha1
    //DigestKeys.algorithms := "md5"
    //includeFilter in digest := "..."
    //excludeFilter in digest := "..."
    
    // HTTP compression with sbt-gzip (https://github.com/sbt/sbt-gzip)
    // ~~~
    // includeFilter in GzipKeys.compress := "*.html" || "*.css" || "*.js"
    // excludeFilter in GzipKeys.compress := "..."
    
    // JavaScript linting with sbt-jshint (https://github.com/sbt/sbt-jshint)
    // ~~~
    // JshintKeys.config := ".jshintrc"
    
    // All work and no play...
    emojiLogs
    
    
    fork in run := true
    

    最佳答案

    克里斯的评论有答案!从 build.sbt 中删除 fork in run 或将其设置为 false。我不确定是否会有下游后果。

    关于eclipse - 调试不适用于 play 框架激活器、scala 和 eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30689192/

    相关文章:

    c - Eclipse CDT 调试不是可执行格式 : File format not recognized after strawberry installation

    java - Eclipse调试空指针异常

    templates - play框架中scala模板中的服务器端评论标签是什么?

    jquery - 在 Chrome 中调试时如何忽略 jQuery 断点?

    c++ - 不理解一些编程模式

    java - 如何将变量的全部内容发送/导出到文本文件/xml 文件/剪贴板?

    java - 在 Eclipse 中查看类层次结构的快捷方式

    scala - 使用通用案例类了解删除

    android - 在 Android 项目中使用 scala-library.jar 会抛出错误 : Library cannot be dexed

    android - Karbonn A18 未在 Eclipse 中检测到以进行调试