0

私はかなりバニラのGrailsアプリを持っています。コントローラー上のドメイン オブジェクト。run-app または run-war を使用してローカルで使用すると、すべて正常に動作します。grails war を使用して WAR ファイルを作成し、Tomcat 7.0.25 webapps ディレクトリにデプロイすると、次のようになります。

エラー 500: 内部サーバー エラー URI/apps2/mriMetricAdjustment/teamResultAdjustment/list Classgroovy.lang.MissingMethodException Message メソッドの署名がありません: com.thrivent.mriAdjustment.domain.TeamResultAdjustment.withCriteria() は引数の型に適用されます: () 値: []可能な解決策: withCriteria(groovy.lang.Closure)、withCriteria(java.util.Map、groovy.lang.Closure)、createCriteria()

withCriteria()はドメイン メソッドであり、このエラーはすべてのドメイン オブジェクトで発生します。私はあらゆる種類のクリーンでリフレッシュされた依存関係、war ビルドのさまざまな環境スイッチを試しました (grails prod war のように)。Tomcat でアプリを完全に吹き飛ばし、再デプロイしました。何もない。私は Groovy Grails Tool Suite 3.1.0、Grails 2.1.1 で作業しています。どんな助けでも大歓迎です。

問題が発生した場所にスタック トレースとコードを追加します。各コントローラーの同じ場所:

[2013-04-19 16:51:43.931] sysCorpMRIMetricAdjustments ajp-bio-8018-exec-2 ERROR rg.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - リクエストの処理中にエラー MissingMethodException が発生しました: [GET] /apps2/ mriMetricAdjustment/teamResultAdjustment/list メソッドの署名なし: com.thrivent.mriAdjustment.domain.TeamResultAdjustment.withCriteria() は引数の型に適用できます: () 値: [] 可能な解決策: withCriteria(groovy.lang.Closure)、withCriteria(java .util.Map、groovy.lang.Closure)、createCriteria()。スタックトレースは次のとおりです: groovy.lang.MissingMethodException: メソッドの署名がありません: com.thrivent.mriAdjustment.domain.TeamResultAdjustment.withCriteria() は引数の型に適用できます: () 値: [] 可能な解決策: withCriteria(groovy.lang.Closure) , withCriteria(java.util.Map, groovy.lang.

def results = TeamResultAdjustment.withCriteria { and { like("recordStatusCode", "A") like ("teamID", "%" + params.tsID + "%") } }

エラーのログとスタック トレースからのスニペットで更新されました。クリアする必要がある Tomcat キャッシュはありますか?

引数の型に適用できます: () 値: [] 考えられる解決策: createCriteria()。スタックトレースは次のとおりです: groovy.lang.MissingMethodException: メソッドの署名がありません: >com.thrivent.mriAdjustment.domain.GoalAdjustment.createCriteria() は >引数の型に適用されます: () 値: [] 可能な解決策: >com での createCriteria() .thrivent.mriAdjustment.controller.GoalAdjustmentController.list(GoalAdjustmentController.groovy:33) >grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilte>r.java:195) at grails.plugin.cache.web. filter.AbstractFilter.doFilter(AbstractFilter.java:63) >java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 908) java.lang で。

` plugins { runtime ":hibernate:$grailsVersion" runtime ":jquery:1.8.0" runtime ":resources:1.1.6"

    // Uncomment these (or add new ones) to enable additional resources capabilities
    //runtime ":zipped-resources:1.0"
    //runtime ":cached-resources:1.0"
    //runtime ":yui-minify-resources:0.1.4"

    build ":tomcat:$grailsVersion"
    //build ":hibernate:$grailsVersion"

    runtime ":database-migration:1.1"

    compile ':cache:1.0.0'
    compile ":grails-ui:1.2.3"
    compile ":yui:2.8.2.1"
    compile ":bubbling:2.1.4"
    compile ":searchable:0.6.4"
    compile ":jquery-ui:1.8.24"
    compile ":jquery-datatables:1.7.5"
    //compile ":hibernate:$grailsVersion"
}`

最後になりましたが、戦争を再インストールしたときのカタリナ ログ:

>Apr 22, 2013 11:50:22 AM org.apache.catalina.startup.HostConfig checkResources
>INFO: Undeploying context [/apps2/mriMetricAdjustment]
>Apr 22, 2013 11:50:22 AM org.apache.catalina.startup.HostConfig deployWAR
>INFO: Deploying web application archive /opt/Apache/Tomcat7.0.25/profiles/sysCorpMRIMetricAdjustments/webapps/apps2#mriMetricAdjustment.war
>Apr 22, 2013 11:50:26 AM org.apache.catalina.core.ApplicationContext log
>INFO: Initializing Spring root WebApplicationContext
>Apr 22, 2013 11:50:55 AM org.apache.catalina.core.ApplicationContext log
>INFO: Initializing Spring FrameworkServlet 'grails'
>Apr 22, 2013 11:54:19 AM org.apache.catalina.core.ApplicationContext log
>INFO: Initializing Spring FrameworkServlet 'gsp'
>Apr 22, 2013 11:54:19 AM org.apache.catalina.core.ApplicationContext log
>INFO: GSP servlet initialized

もう1つの更新...インストール済みのプラグインは次のとおりです。

Plug-ins you currently have installed are listed below:
-------------------------------------------------------------
bubbling            2.1.4            --  Bubbling Library YUI Extension
cache               1.0.0            --  Cache Plugin
database-migration  1.1              --  Grails Database Migration Plugin
grails-ui           1.2.3            --  Grails UI
hibernate           2.1.1            --  Hibernate for Grails
jquery              1.8.0            --  JQuery for Grails
jquery-datatables   1.7.5            --  JQuery DataTables Plugin
jquery-ui           1.8.24           --  jQuery UI resources
resources           1.1.6            --  Resources
searchable          0.6.4            --  Searchable Plugin
tomcat              2.1.1            --  Apache Tomcat plugin for Grails
webxml              1.4.1            --  WebXmlConfig
yui                 2.8.2.1          --  Yahoo! User Interface Library (YUI)
4

2 に答える 2

0

したがって、これはアプリケーション WAR とは何の関係もありませんでしたが、DataSource.groovy に対するサーバー構成の不一致が原因でした。サーバーの名前は「systst」でしたが、DataSource.groovy の環境には「syst* e *st」というラベルが付けられていました。データソース構成が読み込まれなかったため、GORM 構成が発生しなかったと思われます。エラー メッセージはありませんでしたが、ドメイン内のデータソース名を参照しているため、ドメイン オブジェクトが失敗したと思っていました。ありがとうございます!

于 2013-04-23T17:24:14.620 に答える