Grails MissingMethodException:createCriteria在战争中,在本地运行

Grails MissingMethodException:createCriteria在战争中,在本地运行,grails,createcriteria,Grails,Createcriteria,我有一个Grails应用程序,非常普通。控制器上的域对象。在本地使用run app或run war时,一切运行正常。当我使用grails WAR创建WAR文件并部署到Tomcat 7.0.25 webapps目录时,我得到以下信息: 错误500:内部服务器错误 URI/apps2/mrimericaladjustment/teamResultAdjustment/list Classgroovy.lang.MissingMethodException消息没有方法的签名: com.thrivent

我有一个Grails应用程序,非常普通。控制器上的域对象。在本地使用run app或run war时,一切运行正常。当我使用grails WAR创建WAR文件并部署到Tomcat 7.0.25 webapps目录时,我得到以下信息:

错误500:内部服务器错误 URI/apps2/mrimericaladjustment/teamResultAdjustment/list Classgroovy.lang.MissingMethodException消息没有方法的签名: 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工具套件3.1.0、Grails 2.1.1中工作。任何帮助都将不胜感激

在出现问题的地方添加堆栈跟踪和代码。每个控制器中的相同位置:

[2013-04-19 16:51:43.931]系统公司计量调整 ajp-bio-8018-exec-2错误 rg.codehaus.groovy.grails.web.errors.GrailExceptionResolver-错误 处理请求[GET]时发生MissingMethodException /应用程序2/mriMetricAdjustment/teamResultAdjustment/列表无签名 方法: 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.Closure),createCriteria()位于 com.thrivent.mriAdjustment.controller.TeamResultAdjustmentController.list(TeamResultAdjustmentController.groovy:34) 在 grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195) 在 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) 运行(Thread.java:662)

def results=TeamResultAdjustment.withCriteria{
及{
类似(“记录状态代码”、“A”)
例如(“teamID”,“%”+params.tsID+“%”)
}
}

使用错误日志和堆栈跟踪中的代码段进行更新。是否存在需要清除的Tomcat缓存

[2013-04-22 08:42:33.414]sysCorpMRIMetricAdjustments ajp-bio-8018-exec-4 DEBUG>ngframework.beans.factory.support.DefaultListableBeanFactory-调试返回缓存>单例bean“GrailApplication”实例 [2013-04-22 08:42:33.432]sysCorpMRIMetricAdjustments ajp-bio-8018-exec-4 DEBUG>ngframework.beans.factory.support.DefaultListableBeanFactory-调试返回缓存>单例bean“GrailApplication”实例 [2013-04-22 08:42:33.438]syscorpmerimetricadjustments ajp-bio-8018-exec-4 ERROR>rg.codehaus.groovy.grails.web.errors.GrailExceptionResolver-ERROR>MissingMethodException处理请求时发生异常:[GET]/apps2/mriMetricAdjustment>/goalAdjustment/list 没有方法的签名:com.thrivent.mriAdjustment.domain.GoalAdjustment.createCriteria()>适用于参数类型:()值:[] 可能的解决方案:createCriteria()。跟踪如下: groovy.lang.MissingMethodException:没有方法的签名:>com.thrivent.mriAdjustment.domain.GoalAdjustment.createCriteria()适用于>参数类型:()值:[] 可能的解决方案:createCriteria() at>com.thrivent.mriAdjustment.controller.GoalAdjustmentController.list(GoalAdjustmentController.groovy:33) 在>grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilte>r.java:195) 位于grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at>java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)> 位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 运行(Thread.java:662)

` 插件{ 运行时“:hibernate:$grailsVersion” 运行时“:jquery:1.8.0” 运行时“:资源:1.1.6”

最后但并非最不重要的一点是,卡塔琳娜从我退出战争时开始记录:

>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
还有一个更新…以下是我安装的插件:

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)

请分享
控制器
的代码。这对我来说毫无例外

步骤:

http://localhost:8080/demoApp-0.1/foo?name=Foo
  • 已创建
    demoApp
  • 已创建
  • 已创建
    控制器
  • index()
    操作中使用
    与标准
  • grails-war
  • 将WAR部署到Tomcat 7.0.39(最新版本)
你可以找到细节

要点击的URL:

http://localhost:8080/demoApp-0.1/foo?name=Foo

因此,这与应用程序战争无关,而是与服务器配置与DataSource.groovy不匹配有关。服务器名为'systst',但DataSource.groovy中的环境标记为'syst*e*st'。我怀疑GORM配置从未发生过,因为数据源配置从未加载。因此没有错误消息,但是我认为域对象会失败,因为我引用了域中的数据源名称。多亏了所有!

添加了代码和st