【问题标题】:Grails Webflow errors on first access首次访问时出现 Grails Webflow 错误
【发布时间】:2011-03-04 13:05:39
【问题描述】:

我在 Grails 中开发了一个简单的 webflow(主要是为了尝试使用 webflows——在这种情况下有点矫枉过正)。在对 Serializable 对象进行了一些试验和磨难之后,我让它工作了——有时。

这是问题所在——我在启动应用程序 (run-app) 后第一次访问 webflow 时,出现了这个异常:

2010-06-16 09:11:25,580 [http-8080-3] [ERROR] [org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver] No signature of method: groovy.lang.MissingMethodException.to() is applicable for argument types: (java.lang.String) values: [validate]
Possible solutions: is(java.lang.Object), any(), use([Ljava.lang.Object;), getAt(java.lang.String), with(groovy.lang.Closure), any(groovy.lang.Closure)
groovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException.to() is applicable for argument types: (java.lang.String) values: [validate]
Possible solutions: is(java.lang.Object), any(), use([Ljava.lang.Object;), getAt(java.lang.String), with(groovy.lang.Closure), any(groovy.lang.Closure)
        at com.sbs.component.survey.SurveyDefinitionController.invokeMethod(SurveyDefinitionController.groovy)
        at com.sbs.component.survey.SurveyDefinitionController$_closure3.doCall(SurveyDefinitionController.groovy:23)

如果我“触摸”控制器(进行任何编辑,即使只是添加一个空格)然后保存文件,webflow 就会开始工作......似乎在控制器重新加载之前有些东西没有连接至少一次。显然这是一个非首发......任何想法是什么导致了这个?

我在 Mac OSX Java 1.6 上使用 Grails 1.3.1。

这是网络流的框架:

def createSurveyFlow = {
        select {

            }.to("validate")
            on("cancel").to("finish")
        }

        validate {
            on("approve") {

            }.to("finish")
            on("disapprove").to("select")
            on("cancel").to("finish")
        }

        finish {
            action {
                flash.message = "SurveyDefinition created"            
            }
            redirect(controller:"surveyDefinition", action:"index")
        }

    }

【问题讨论】:

    标签: grails spring-webflow missingmethodexception


    【解决方案1】:

    我可能已经弄明白了——似乎 webflow 定义和控制器操作不太像在同一个控制器上。当我将 webflow 移动到它自己的控制器时,这个(和其他)问题似乎消失了。至少目前是这样。如果/当我了解更多信息时,我会报告。

    【讨论】:

      猜你喜欢
      • 2011-12-14
      • 2013-01-24
      • 2020-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-15
      相关资源
      最近更新 更多