I can't find any documentation or examples of debugging Scalatra apps in IntelliJ Idea. Is it possible to run the Scalatra app in debug mode to attach the Idea?
Asked
Active
Viewed 2,291 times
5
-
On the last ScalaDev i've asked one of JetBrains' guys about scalatra support and he told that have plans to add it soon – 4lex1v May 23 '13 at 15:28
-
1Debugging any JVM app, including scalatra should be no different from the way described in the above link. First -- you're starting scalatra with additional options (they're listed in that topic and in IDEA run configurations tab), then you're attaching IDEA debugger [in remote mode](https://www.jetbrains.com/idea/webhelp/run-debug-configuration-remote.html). – om-nom-nom May 23 '13 at 15:30
-
@om-nom-nom, I don't know how to start the scalatra app in debug mode, and my question clearly states that. – Valentin V May 23 '13 at 15:34
1 Answers
10
First. Go to the IDEA an choose edit configurations action:
On this tab, add new remote configuration:
Next, run Scalatra with those options:
For example:
java
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar **-assembly-**.jar
Now hit the green debug button of your IDEA and enjoy debugging. There might be another ways to run scalatra (e.g. from sbt jetty-run) but generally all you need is to feed those options to the jvm instance.

om-nom-nom
- 62,329
- 13
- 183
- 228