Grails 2.3 breakpoints

I've always had luck setting breakpoints and debugging Grails with Intellij but with the latest Grails (2.3 RC1 and RC2) I'm unable to hit the breakpoints I've set. I've tried a few different versions of Intellij: 12.1.4 and EAP 130.1619 and 132.27. What's odd is that the breakpoint icon remains a solid red circle - no checkmark or x. Is it possible that its not locating the associated class files?

Thanks!
Tom

4 comments

I ran a quick test and found the same result...but then something did come to mind...

It's to do with
http://grails.org/doc/2.3.x/guide/upgradingFromPreviousVersionsOfGrails.html

look at section entitled "Forked Execution for Testing" where it tells about amending BuildConfig.

It's also mentioned here
http://grails.1312388.n4.nabble.com/Any-way-to-debug-2-3-RC2-app-from-Intellij-Cardea-td4648600.html

which is actually what I did just about remember, eventually. However I did try using the -debug-fork first but coldn't get that to work.

But...having amended BuildConfig to set the forking for test and run to false (as above) when I use IDEA Run->Debug and try to 'Toggle Line Breakpoint' I always get ' Warning no executable code found at..." regardless of where I try to set the breakpoint. And so I tried to just run the program, connected to it from the browser and did a few things and to my surprise it did catch one breakpoint. It's a bit baffling but, superficially, it seems that it doesn't mind a breakpoint on an ordinary line but a method def line ("def show(Thing thingInstance) {...") doesn't work and still shows 'No executable" but the others are now ticked, and seemingly working. Just checking again - it seems to mark the breakpoint as 'no executable' when I create it but then if the program gets to that line the red dot's 'x' is replaced by a tick and it does, indeed, work as a breakpoint thereafter. Is this a bug ?

Still confused a little...

graham

0

Thanks Graham! I'm sure you're right about the forked execution change that happened with Grails 2.3. It seems like we should be able to use a remote connection to get the same functionality. I've tried a few things to get it working but no luck so far. I'll post steps here once I get it figured out.

Thanks again,
Tom

0

The link that I gave http://grails.1312388.n4.nabble.com/Any-way-to-debug-2-3-RC2-app-from-Intellij-Cardea-td4648600.html certainly mentioned remote debugging but the poster didn't say specifically whether that worked after the changes.
My BuildConfig has:

grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
//  compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

// configure settings for the test-app JVM, uses the daemon by default
test: false,
// configure settings for the run-app JVM
run: false,
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
...

and, with the proviso about the odd behaviour with the breakpoints when first created, the breakpoints appeared to work fine. But I will admit to not having tried remote debugging at all.

graham

0

Thanks Graham, you're right. I'm seeing similar breakpoint behavior to that which you described now. I misunderstood your first post to say that breakpoints using that method was not completely reliable. Thanks again for pointing out the thread! For what its worth I wasn't able to get grails-app --debug-fork to work either.

Thanks again!

0

Please sign in to leave a comment.