Question

I have a Grails app that is pretty vanilla. Domain objects over controllers. Everything runs fine when using locally using run-app or run-war. When I create the WAR file using grails war and deploy to Tomcat 7.0.25 webapps directory, I get the following:

Error 500: Internal Server Error URI/apps2/mriMetricAdjustment/teamResultAdjustment/list Classgroovy.lang.MissingMethodException MessageNo signature of method: com.thrivent.mriAdjustment.domain.TeamResultAdjustment.withCriteria() is applicable for argument types: () values: [] Possible solutions: withCriteria(groovy.lang.Closure), withCriteria(java.util.Map, groovy.lang.Closure), createCriteria()

withCriteria() is a domain method and this error is on all domain objects. I have tried all manner of clean, refresh dependencies, various environment switches on the war build (as in grails prod war). I've totally blown away the app on Tomcat and redeployed. Nothing. I'm working in the Groovy Grails Tool Suite 3.1.0, Grails 2.1.1. Any help would be greatly appreciated.

Adding stack trace and code where issue gets hit. Same place in each controller:

[2013-04-19 16:51:43.931] sysCorpMRIMetricAdjustments ajp-bio-8018-exec-2 ERROR rg.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - error MissingMethodException occurred when processing request: [GET] /apps2/mriMetricAdjustment/teamResultAdjustment/list No signature of method: com.thrivent.mriAdjustment.domain.TeamResultAdjustment.withCriteria() is applicable for argument types: () values: [] Possible solutions: withCriteria(groovy.lang.Closure), withCriteria(java.util.Map, groovy.lang.Closure), createCriteria(). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: com.thrivent.mriAdjustment.domain.TeamResultAdjustment.withCriteria() is applicable for argument types: () values: [] Possible solutions: withCriteria(groovy.lang.Closure), withCriteria(java.util.Map, groovy.lang.Closure), createCriteria() at com.thrivent.mriAdjustment.controller.TeamResultAdjustmentController.list(TeamResultAdjustmentController.groovy:34) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)

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

Updated with a snippet from the log and stack trace of the error. Is there a Tomcat cache that needs to be cleared?

[2013-04-22 08:42:33.414] sysCorpMRIMetricAdjustments ajp-bio-8018-exec-4 DEBUG >ngframework.beans.factory.support.DefaultListableBeanFactory - debug Returning cached >instance of singleton bean 'grailsApplication' [2013-04-22 08:42:33.432] sysCorpMRIMetricAdjustments ajp-bio-8018-exec-4 DEBUG >ngframework.beans.factory.support.DefaultListableBeanFactory - debug Returning cached >instance of singleton bean 'grailsApplication' [2013-04-22 08:42:33.438] sysCorpMRIMetricAdjustments ajp-bio-8018-exec-4 ERROR >rg.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - error >MissingMethodException occurred when processing request: [GET] /apps2/mriMetricAdjustment>/goalAdjustment/list No signature of method: com.thrivent.mriAdjustment.domain.GoalAdjustment.createCriteria() >is applicable for argument types: () values: [] Possible solutions: createCriteria(). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: >com.thrivent.mriAdjustment.domain.GoalAdjustment.createCriteria() is applicable for >argument types: () values: [] Possible solutions: createCriteria() at >com.thrivent.mriAdjustment.controller.GoalAdjustmentController.list(GoalAdjustmentController.groovy:33) at >grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilte>r.java:195) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at >java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)

` 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"
}`

Last but not least - the catalina logs from when I resinstall the war:

>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

One more update...here are my installed plug-ins:

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)
Was it helpful?

Solution 2

So this had nothing to do with the application WAR but rather with the server configuration mismatching against DataSource.groovy. The server was named 'systst' but the environment in the DataSource.groovy was labeled 'syst*e*st.' I suspect that the GORM configurations never happened because the datasource configurations were never loaded. There were no error messages, however I would have thought the Domain objects would have failed since I reference the datasource name in the Domain. Thanks to all!

OTHER TIPS

Please share the code for the domain and controller. It worked for me without any exception.

Steps:

  • Created demoApp
  • Created domain
  • Created controller
  • Used withCriteria from index() action
  • grails war
  • Deployed WAR to Tomcat 7.0.39 (latest)

You can find the details here.

URL to hit:

http://localhost:8080/demoApp-0.1/foo?name=Foo
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top