【问题标题】:Why am I getting a SnapshotNotFoundException when Spring WebFlow is starting?为什么在 Spring WebFlow 启动时会收到 SnapshotNotFoundException?
【发布时间】:2013-11-05 19:52:35
【问题描述】:

好吧,我所做的只是试图进入我的第一页。我收到以下异常:

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
  • 弹簧数据
  • JPA 2.0,带有/通过自定义 JpaFlowExecutionListener

我的 JpaFlowExecutionListener 的唯一自定义部分是我将 EntityManager 从范围中分离出来的部分,以便它可以序列化流 - 我将其作为数据库支持的流持久性设置。流被保存/读取/读取到 db ok。但我无法让它渲染第一个视图。

据我所知,这是它在下面崩溃之前所经历的步骤:

  1. FlowExecutorImpl 代码调用launchExecution()。
  2. PersistentConversation 已创建。
  3. PersistentConversation 线程已锁定
  4. PersistentConversation 放入 executionRepository 和 PersistentConversationHolder 的 ThreadLocal 会话映射中。 (保留活动线程的对话列表)
  5. 解锁 - 导致删除 ThreadLocal 映射中的 PersistentConversation
  6. 然后调用 FlowExecutorImpl createPausedResult(flowExecution)
  7. 最终调用 FlowExecutorImpl resumeExecution()。
  8. 使用 FlowID 在 PersistenceConversationHolder 映射中查找 PersistentConversation,但在此处不再找到 PersistentConversation。
  9. 从数据库中检索并将 db 对象填充到新的 PersistentConversation 中。
  10. 尝试从其快照列表中恢复对话,但已在第 5 步中删除。

对于 PersistenceConversationHolder,请参考 book here 中的示例。

任何帮助将不胜感激!

【问题讨论】:

    标签: spring-mvc spring-webflow spring-data


    【解决方案1】:

    如果有人也像我一样错过了这个......

    在上面的步骤#5当线程被解锁时,你需要更新保存/更新PersistentConversation到数据库,这个副本将包含所有的快照信息。

    一旦我写了这篇文章,很容易看出有一个缺失的步骤。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      • 2012-03-05
      • 1970-01-01
      • 2022-11-11
      相关资源
      最近更新 更多