【发布时间】:2014-08-23 11:16:44
【问题描述】:
我正在尝试运行流程(Grails 2.3.11、Spring Web Flow 2.0.8.1、JDK 1.7.0_21、OS X 10.9.4)。
第一次启动应用程序时(通过在命令行中输入“grails run-app”),我可以进入流程的第一页,流程似乎工作正常。
但是,下次我尝试执行流程时,我收到以下错误(来自控制台)。即使我删除了我的 cookie 并重新启动应用程序,也会发生这种情况。如果我把它放几天再回来,它似乎又可以工作了(仅限第一次)。
我找到了六年前的 thread,但我没有像原始海报那样调用 flow.clear()。我的流程代码如下。
有人对此有任何见解吗?
错误:
[ERROR] 27 Jul 2014 21:54:14,086 org.springframework.webflow.engine.impl.FlowExecutionImpl FlowExecutionListener threw exception
java.lang.NullPointerException
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:191)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
[ERROR] 27 Jul 2014 21:54:14,096 org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver IllegalArgumentException occurred when processing request: [GET] /inscriba/author/createAuthor - parameters:
execution: e1s2
Session must not be null. Stacktrace follows:
org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'headshot' of flow 'author/createAuthor'
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:191)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Session must not be null
... 5 more
代码:
def createAuthorFlow = {
log.debug("createAuthorFlow: I am here: ")
create {
log.debug("create: I am here")
on("next") {
log.debug("create.next: I am here")
flow.author = new Author(params)
!flow.author.validate() ? error() : success()
flow.author.save()
}.to "headshot"
}
headshot {
on("next") {
log.debug("headshot.next: I am here")
}.to "summary"
}
summary()
}
【问题讨论】:
-
嗨!有关于这个问题的消息吗?