Which would be the workflow to debug with IntelliJ's IDEA ?

267 views
Skip to first unread message

Alberto Yanez

unread,
Mar 30, 2013, 9:22:45 PM3/30/13
to scalat...@googlegroups.com
I have managed to modify the code and have it reload by JRebel when running Jetty from SBT. However, that way the breakpoints in IDEA do not work. So I added an Embedded Jetty Object to run Jetty from withing IDEA

object JettyEmbedded {

  def main(args: Array[String]) {
    val server = new Server(9080)
    val context: WebAppContext = new WebAppContext();
    context.setServer(server)
    context.setContextPath("/");
    context.setWar("src/main/webapp")
    server.setHandler(context);

    try {
      server.start()
      server.join()
    } catch {
      case e: Exception => {
        e.printStackTrace()
        System.exit(1)
      }
    }
  }
}


Now I have 2 problems: 
  • the JRebel plugin within IDEA does not reload the modified classes. 
  • I am having problems getting the Embedded Jetty to pick some Jade Templates 
I am new to JRebel and Scalatra so probably there are several things that I am missing.  Please provide suggestions on how to improve my debugging workflow.

-Thanks

Alberto Yanez

unread,
Mar 31, 2013, 2:21:47 AM3/31/13
to scalat...@googlegroups.com
I found that setting IDEA for remote debugging is easier:

  1. Setup as instructed.
  2. Go to command window and set JAVA_OPTS environment variable: "set JAVA_OPTS=-javaagent:/stools/jrebel/jrebel.jar %JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
  3. Start sbt
  4. Start Jetty: container:start
  5. Set sbt to monitor sources: "~ ;copy-resources;aux-compile"
Everything is working except I get a JRebel error whenever I change the source code:

[2013-03-31 00:06:32] JRebel: Class 'org.fusesource.scalate.support.ScalaCompiler' could not be processed by org.zeroturnaround.jrebel.s...@java.net.URLClassLoader@13109a54
org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] askShutdown() not found in scala.tools.nsc.Global

So far the error doesn't seem to have an impact....but if anybody knows how to fix this it would be great.

Thanks,
Reply all
Reply to author
Forward
0 new messages