2
votes

I'm working on a grails project with intellij idea 12.1.4. I need to debug my application but the debugging doesn't work.

I just choose my normal runconfiguration, wich works perfectly in normal mode and press the debug button.

After that the grails app does start but doesn't come to the spring security loading part and doesn't start fully.

    /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:51583,suspend=y,server=n -Dgrails.home=/Users/patrick/Workspace/SDKsFrameworks/grails-2.2.3 -Dbase.dir=/Users/patrick/Workspace/bonExperten -Dtools.jar=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/tools.jar -Dgroovy.starter.conf=/Users/patrick/Workspace/SDKsFrameworks/grails-2.2.3/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -javaagent:/Users/patrick/Workspace/SDKsFrameworks/grails-2.2.3/lib/org.springsource.springloaded/springloaded-core/jars/springloaded-core-1.1.3.jar -noverify -Dspringloaded=profile=grails -Dfile.encoding=UTF-8 -classpath "/Users/patrick/Workspace/SDKsFrameworks/grails-2.2.3/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.0.8.jar:/Users/patrick/Workspace/SDKsFrameworks/grails-2.2.3/dist/grails-bootstrap-2.2.3.jar:/Applications/IntelliJ IDEA 12.app/lib/idea_rt.jar" org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf /Users/patrick/Workspace/SDKsFrameworks/grails-2.2.3/conf/groovy-starter.conf run-app
Connected to the target VM, address: '127.0.0.1:51583', transport: 'socket'

| Loading Grails 2.2.3
| Configuring classpath
| Configuring classpath.
| Environment set to development
| Environment set to development.
| Environment set to development..
| Environment set to development...
| Environment set to development....
| Environment set to development.....
| Packaging Grails application
| Packaging Grails application.
| Packaging Grails application..
| Packaging Grails application...
| Packaging Grails application....
| Packaging Grails application.....
| Running Grails application
Jun 25, 2013 1:23:31 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 25, 2013 1:23:31 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Jun 25, 2013 1:23:31 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
Jun 25, 2013 1:23:31 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
Jun 25, 2013 1:23:31 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Disconnected from the target VM, address: '127.0.0.1:51583', transport: 'socket'

Process finished with exit code 255

Does somebody know a solution for that?

1
Sorry, maybe I misunderstood.. do you click on run button and then on debug button? If so, why don't you just click on debug button? With the standard intellij config for grails projects, it will start the application in debug mode. - lucke84
No, i only click on the debug button as i'm used it (i do not click on the run button). But this doesn't work. - whitenexx

1 Answers

0
votes

This could be being caused by forked tomcat execution settings in your BuildConfig.groovy file. I think what happens is that Intellij gets confused about which Java process to attach to when Grails spins up. You could try disabling execution forking by replacing the grails.project.fork settings with:

   grails.project.fork = [
            test: false,
            run: false,
            war: false,
            console: false
    ]