grails プラグイン tomcat-1.3.4 で構成され、Spring (3.0.3RELEASE) を使用して構成された Grails (1.3.4) アプリを構築していますが、既存の Spring applicationContext.xml ファイルを再利用しています。古いファイルの関連部分を、Grails によって生成されたファイル (characterEncodingFilter Bean のすぐ下) にコピーしました。必要なすべてのjarがクラスパスにあり、Bean名に競合がないことを確認した後(DataSource.groovyファイルが存在する場合、dataSourceがすでに使用されていることがわかったので、それを削除して解決しました)、私はIllegalStateException に直面しました。スタック トレースとそれに続くデバッグ ログの一部は次のとおりです。
2010-09-30 15:29:36,131 [main] DEBUG xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
2010-09-30 15:29:36,143 [main] DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'grailsApplication'
2010-09-30 15:29:36,149 [main] ERROR context.GrailsContextLoader - Error executing bootstraps: postProcessBeanDefinitionRegistry already called for this post-processor
java.lang.IllegalStateException: postProcessBeanDefinitionRegistry already called for this post-processor
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:164)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
更新: applicationContext.xml の先頭にある次の行をコメント アウトすると、無限ループに入ります。
<context:annotation-config/>
<context:property-placeholder location="WEB-INF/config.properties"/>
インポート行もコメントアウトすると、期待どおりに実行されます。インポート行は次のとおりです。
<import resource="conf/membershipData.xml"/>
<import resource="conf/membershipServices.xml"/>
/アップデート
デバッガーをトレースすると、起動中の applicationContext の更新中に発生することがわかりました (DefaultRuntimeSpringConfiguration:154)。
関連する場合は、run-app コマンドの前にすべての jar 挿入を処理する IntelliJ IDEA 9 を使用しています。
ご協力いただきありがとうございます。