我正在使用intellij idea 12.1.4开展grails项目。 我需要调试我的应用程序,但调试不起作用。
我只选择正常的运行配置,在正常模式下完美运行并按下调试按钮。
之后,grails应用程序确实启动但没有进入弹簧安全加载部分,并且无法完全启动。
/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
有人知道解决方案吗?
答案 0 :(得分:0)
这可能是由BuildConfig.groovy文件中的分叉tomcat执行设置引起的。我认为发生的事情是,当Grails旋转时,Intellij会对要附加的Java进程感到困惑。您可以尝试通过将grails.project.fork设置替换为:
来禁用执行分支 grails.project.fork = [
test: false,
run: false,
war: false,
console: false
]