Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug not working with play framework activator, scala and eclipse

There are many posts on this, the instructions are straight forward, but for the life of me I can't get the debugger to stop at breakpoints.

My environment is

  • eclipse 4.4.1
  • scala 2.11
  • scala IDE 4.1.0.nightly
  • play framework 2.3.3
  • play support in Scala IDE 0.4.6

I launch activator as follows

activator -jvm-debug 9999 run

I have set up a remote java application debug configuration with standard socket attach. The debug configuration runs, attaches to the remote and launches a bunch of sbt threads.

But, it will not stop in the debugger! It doesn't seem that hard, what am I doing wrong?

Edit: I have this problem in a project I've been working on for a while and in a brand new, untouched instantiation of the play-anguale-require-seed project. Here is the build.sbt for that project:

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
like image 665
Evan Thomas Avatar asked Jun 07 '15 01:06

Evan Thomas


People also ask

How do I enable debugging in Eclipse?

A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead. Either actions mentioned above creates a new Debug Launch Configuration and uses it to start the Java application.

How do I run a debug in play framework?

Generate configuration To debug, start your application with activator -jvm-debug 9999 run and in Eclipse right-click on the project and select Debug As, Debug Configurations. In the Debug Configurations dialog, right-click on Remote Java Application and select New. Change Port to 9999 and click Apply.

What is Eclipse drop to frame debugging?

6. Drop to frame. Eclipse enables users to choose any frame (level) in the call stack during the debugging process and set the JVM to start again from the selected level. In simple words, it allows you to re-run a part of your program.


1 Answers

Kris' comment has the answer! Remove fork in run from the build.sbt or set it to false. I'm not sure if there will downstream consequences.

like image 185
Evan Thomas Avatar answered Oct 23 '22 17:10

Evan Thomas