lift-cookbook icon indicating copy to clipboard operation
lift-cookbook copied to clipboard

Debugging with Intellij

Open d6y opened this issue 12 years ago • 2 comments

d6y avatar Jan 29 '13 10:01 d6y

I had to do this for the first time last week. What I did was....

  1. Modify my SBT script to enable all the JVM debugging flags:
$ cat `which sbt`  
![Debug - Unnamed 2013-01-28 21-54-04](https://f.cloud.github.com/assets/102661/106509/64378f90-69fb-11e2-8d54-de11149b42c2.jpg)
![Debug - Unnamed 2013-01-28 21-54-04](https://f.cloud.github.com/assets/102661/106511/6d35120c-69fb-11e2-89fd-8f02eb6e7cef.jpg)
WITH_DEBUG=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
java $WITH_DEBUG -Drun.mode=development -XX:MaxPermSize=556m -Xmx712M -Xss2M $WITH_REBEL -XX:+CMSClassUnloadingEnabled -jar `dirname $0`/sbt-launch.jar "$@"

(ignore with WITH_REBEL part)

  1. Start SBT and container:start as normal.
  2. In IntelliJ, with my Lift project open, Selected Run> Debug..., selected Edit Configurations, selected the + icon, selected Remote, gave it a name and pressed Debug.

I thought I'd end up just debugging SBT :-) but I could set breakpoints in my Lift app and the debugging jumped up when I reached that point in the browser.

d6y avatar Jan 29 '13 10:01 d6y

Debug - Unnamed 2013-01-28 21-54-04

d6y avatar Jan 29 '13 10:01 d6y