调试不使用play framework activator,scala和eclipse

Eva*_*mas 7 eclipse debugging scala playframework playframework-2.3

有很多帖子,说明很直接,但对于我的生活,我无法让调试器停在断点处.

我的环境是

  • 日食4.4.1
  • 斯卡拉2.11
  • scala IDE 4.1.0.nightly
  • 播放框架2.3.3
  • 在Scala IDE 0.4.6中支持

我按如下方式启动激活器

activator -jvm-debug 9999 run
Run Code Online (Sandbox Code Playgroud)

我已经设置了一个带有标准套接字附加的远程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
Run Code Online (Sandbox Code Playgroud)

Eva*_*mas 8

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


Max*_*Max 0

  1. 尝试在正常模式下运行并将控制台日志的前两行复制粘贴到编辑器中。
  2. 在调试模式下执行相同操作。
  3. 比较 :
    • 在第一行,在调试模式(不是正常模式)下,您应该具有以下内容(带有 suspend= y):
      agentlib:jdwp=transport=dt_socket,address=127.0.0.1:xxxxx,suspend= y ,server=n
    • 在调试模式下(不是正常模式)应该出现第二行:
      Connected to the target VM, address: '127.0.0.1:xxxxx', Transport: 'socket'

suspend=y 使您的服务器等待连接。它可能是n

  1. 检查远程调试器的配置并检查用于侦听的主机(localhost)和端口(9999)以及其他一些选项(传输等)。它应该与启动器中的匹配。