Monday, November 15, 2010

Debugging grails in Netbeans

Grails plugin for Netbeans lacks some must have features like test launching from IDE and so on. Fortunately, Grails debugging is still super-simple with Netbeans. All you have to do is to run Grails from console with grails-debug instead of simply grails. For example, you want to debug test SeleniumTest.
Just type command in command console:
grails-debug test-app functional: SeleniumTest
Then go to Netbeans and select from menu Debug > Attach Debugger..., by default there is JPDA debugger, connector - SocketAttach, just enter your host and port (default is 5005, you can see yours in Grails console). Press OK. And it should connect to Grails process, so it will stop on breakpoints. Easy.
One thing to notice is that if you want to evaluate some expression in debug mode, you should use Java, but not Groovy, at least now.

No comments:

Post a Comment