首次访问时 Grails Webflow 错误
我在 Grails 中开发了一个简单的 webflow(主要是为了尝试使用 webflows - 对于这种情况来说有点矫枉过正)。经过对可序列化对象的一些尝试和磨难后,我有时可以让它工作。
这是问题 - 启动应用程序(运行应用程序)后第一次访问网络流时,我收到此异常:
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)
如果我“触摸”控制器(进行任何编辑,即使只是添加空格)然后保存文件,网络流开始工作...似乎在控制器至少重新加载一次之前,某些东西还没有连接起来。显然这是不可能的……你知道是什么原因造成的吗?
我在 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")
}
}
I've developed a simple webflow in Grails (mostly to experiment with using webflows- its a bit overkill for this case). After some trials and tribulations with Serializable objects, I have it working - sometimes.
Here's the rub- the first time I access the webflow after starting the app (run-app), I get this exception:
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)
If I "touch" the controller (make any edit, even if just adding a white-space) and then save the file, the webflow starts to work... it seems something is not getting wired up until the controller reloads at least once. Obviously this is a non-starter... any ideas what's causing this?
I'm using Grails 1.3.1 on Mac OSX Java 1.6.
Here's the skeleton of the webflow:
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")
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能已经弄清楚了 - 看起来 webflow 定义和控制器操作不太像在同一个控制器上。当我将网络流移动到它自己的控制器时,这个(和其他)问题似乎消失了。至少现在是这样。如果/当我了解更多信息时,我会报告。
I may have figured it out- it seems out that webflow definitions and controller actions don't much like being on the same controller. When I moved the webflow to it's own controller, this (and other) issues seemed to go away. For now, at least. I'll report back if/when I learn more.