Debugging Grails in NetBeans 6.7 Beta
NetBeans 6.7 Beta is a great release for the Grails community. NetBeans' support of Grails functionality is nearly on par with that of IntelliJ 8.1. But there is one glaring omission, debugging support. As it turns out, the NetBeans debugger does work with Grails, it just needs a little love to get it going.
Here's the steps you need to take if you wish to debug your Grails application:
- At the command line, navigate to your project's root folder
- Run the Grails' application in debug mode with the following command:
grails-debug run-app
The application is now up and running in debug mode, which means you may attach the NetBeans debugger on port 5005. - In NetBeans, select Debug > Attach Debugger

Figure 1. Attach Debugger Menu Item
- The "Attach" dialog will appear. Enter port number 5005. Accept the rest of the default values.

Figure 2. Attach Dialog
- Set your breakpoints and enjoy!
For more details, please see the mailing list thread at http://www.nabble.com/Debugging-Groovy-classes-in-NetBeans-td20653361.html

Thanks