好吧,我所做的只是试图到达我的第一页。我收到以下异常:
org.springframework.webflow.execution.repository.snapshot.SnapshotNotFoundException:
No flow execution snapshot could be found with id '1'; perhaps the snapshot has been removed?
我正在使用以下内容:
- Spring Webflow 2.3(带有持久性上下文标志)
- Spring 安全
- Spring MVC
- Spring 数据
- JPA 2.0,使用/通过自定义 JpaFlowExecutionListener
我的 JpaFlowExecutionListener 的唯一自定义部分是我将 EntityManager 从范围中分离出来的部分,以便它可以序列化流 - 我将其作为数据库支持的流持久性设置。流可以保存到数据库或从数据库读取。但我无法让它渲染第一个 View 。
据我所知,下面是崩溃之前所经历的步骤:
- FlowExecutorImpl 代码调用 launchExecution()。
- 持久对话已创建。
- PersistentConversation 线程已锁定
- 将 PersistentConversation 放入executionRepository 和 PersistentConversationHolder 的对话的 ThreadLocal 映射中。 (保留事件线程的对话列表)
- 解锁 - 导致删除 ThreadLocal Map 中的 PersistentConversation
- 然后调用 FlowExecutorImpl createPausedResult(flowExecution)
- 最终会调用 FlowExecutorImplresumeExecution()。
- 使用 FlowID 在 PersistenceConversationHolder 映射中查找 PersistenceConversation,但在这里不再找到 PersistenceConversation。
- 从数据库中检索并将数据库对象填充到新的 PersistentConversation 中。
- 尝试从快照列表中恢复对话,但该对话已在第 5 步中删除。
对于 PersistenceConversationHolder 请引用此 book here 中的示例。
任何帮助将不胜感激!
最佳答案
万一有人也像我一样错过了这个......
在上面的步骤 #5 中,当线程解锁时,您需要更新保存/更新 PersistentConversation 到数据库,此副本将包含所有快照信息。
一旦我写了这篇文章,很容易发现缺少一步。
关于spring-mvc - 为什么当 Spring WebFlow 启动时我会收到 SnapshotNotFoundException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19797660/