IntelliJ IDEA Debugger isn't working on a Grails Project

后端 未结 11 1824
孤独总比滥情好
孤独总比滥情好 2020-12-07 22:45

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 brea

11条回答
  •  被撕碎了的回忆
    2020-12-07 23:42

    None of the other answers work for me on Grails 3.x in 2016 w/ Intellij 15.0.4. This does work for me:

    Start grails in intellij with this command:

    run-app  --debug-jvm
    

    The console should output: "Listening for transport dt_socket at address: 5005 Grails application running at http://localhost:8080 in environment: development"

    Now you can add a new configuration of type, "Remote", in Intellij. Then start it with its defaults.

    And the new debug console window should write: "Connected to the target VM, address: 'localhost:5005', transport: 'socket'"

    Done.

    For those interested, the reference to grails 3.x documentation for starting a debuggable server is at section 2.8, runningAndDebuggingAnApplication:

    http://grails.github.io/grails-doc/3.1.x/guide/gettingStarted.html#runningAndDebuggingAnApplication

    "There are several ways to execute the Application class, if you are using an IDE then you can simply right click on the class and run it directly from your IDE which will start your Grails application. This is also useful for debugging since you can debug directly from the IDE without having to connect a remote debugger when using the run-app --debug-jvm command from the command line."

    Important Note. When I tried the "simply right click on the class and run it directly from your IDE", the app did start. However, all requests I sent to my controller resulted in 500 errors with message: "Could not resolve view with name '/myendpoint' in servlet with name 'grailsDispatcherServlet'.

    So, I reverted back to the instructions above.

提交回复
热议问题