I can't debug my code in Intellij IDEA. When debug mode is active and running, but the breakpoints don't have that "v" checked that represents a valid and stoppable breakpoint.
See the image: http://prntscr.com/1w0owu.
I really search on the web for an answer. What I suppose to do?
Try this:
In idea choose Edit configurations from list next to 'run' button. Then add Remote, choose your name and left default remote configuration settings. (port 5005 etc)
Run your app from console by using
In idea, choose your configuration from list and hit debug button when console display info:
Just three guesses:
Try running
run-app
, notrun-war
, both should work, but may berun-war
just isn't working.Or: try debugging remotely from console:
grails -debug run-app
and then connect with Remote Debug in Idea.Or, the last resort: downgrading your project to previous Grails versions could work. Yes, this is really annoying.
Hope this helps.
I tested with intellij latest with Grails 2.3.4 on Mac Os x Lion.
Then I tried Igors's advice and it is working without forked mode.
Please check for detail grails documentation
if you want to debug forked mode you should check following blog post explainsvery well.
http://blog.jdriven.com/2013/12/grails-goodness-debugging-app-forked-mode/
This is a very simple matter with Grails 3 and Idea (2016.1). There's no need to edit any files anymore, as recommended in the other answers.
For some reason, the debug icon in the Idea toolbar is greyed out, so you just have to navigate to your application entry point (the class that has the static void main method that starts the application), click on one of the run arrows in the left-hand gutter and select the Debug option.
From the JetBrains docs:
https://www.jetbrains.com/help/idea/2016.1/getting-started-with-grails-3.html
Debugging a grails (2.3+) application can be done in two ways.
1. Simple solution: disable debug
edit BuildConfig.groovy:
to
Pros:
Cons:
2. Involved solution: debug forked runtime
This is a somewhat more complex solution where you attach a debugger to a running grails application. It is described in more detail in this blog post.
After setup you have an extra run configuration that allows you to start up grails in forked mode, and yet another extra run configuration that allows you to debug that forked mode. The catch is that you are required to start both or it does not work.
Pros:
Cons:
Considerations
Solution 2 is mostly superior in the sense that it allows flexibility. I personally don't use debug a lot, so just start in normal mode. When I want to debug, I restart in debug mode.
Solution 1 is strictly better if you need to debug and also need to restart a lot. For instance when you are working on your domain classes or database setup in your BootStrap.groovy.
I have tried all mentioned here without success. The only helpful information is here.
In essence you should disable forked execution by adding the following to
grails-app/conf/BuildConfig.groovy
:Now debugging is available in IntelliJ IDEA Ultimate Edition v.12.1.6 just by ordinary Debug without Remote debugging. Tested on Grails 2.3.1, Java 1.7.0_45, Windows 7 64-bit.