简体   繁体   中英

Play Framework 2 debug not working

I'm having a nightmare of a time with debugging Play Framework applications specifically code hot swapping. I'm using the latest version (with activator 1.3.2) and I'm developing in Java not Scala.

I start the application using "activator -jvm-debug 9999 run" (also tried "activator -jvm-debug 9999 ~run") then from Eclipse I attach the debugger to port 9999 as usual and so far so good, debugging works fine (even though a bit slow, but that seems to be normal with Play).

Problem starts as soon as I edit any java file on Eclipse and save Play never picks up the changes and code hot swapping won't work, from this point on it seems Play just stops waiting for something as all my REST calls time out. If I stop the debugger from Eclipse, Play restores from this state and the hot swapping starts and I can once again make the REST calls. If I attach the debugger again things I can usually debug again, but this doesn't always work.

This only happens in debug mode, if I use "activator run" everything runs fine. If I run in debug mode, but never attach the debugger to it everything also runs fine, problems seem to start only if the debugger is attached.

So I can't actually do any coding since debugging is pretty much impossible and I wonder if Play is this unstable or if there's some known issue regarding this. I tried my best at searching for similar issues without any luck.

It's hard to figure out what is going on with so little information, but my usual debug workflow, with no hot swapping issue, is:

$ activator -jvm-debug # 9999 is the default port, you can omit it
[myapp] $ run

After that, I just connect the Eclipse debugger, with no further issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM