NoSuchConversationException Spring Web Flow

时间:2014-09-15 09:07:42

标签: spring jsf-2.2 spring-webflow-2

使用此帖子在弹簧网络流程中实施自定义对话管理器后,成功保存数据库中的http://forum.spring.io/forum/spring-projects/web/web-flow/119955-spring-webflow-2-working-with-persistent-conversation-data.The值{/ p>。

现在的问题是,当用户明确退出应用程序时,注销屏幕显示,但 URI仍包含已过期,已结束且无效的对话ID ,并且当用户再次尝试登录时窗口,他/她得到NoSuchConversationException异常(见下面的代码)。

我获得例外的类

 public class PersistentConversationManager implements ConversationManager, Serializable{
    private static final long serialVersionUID = 1L;

@Autowired
PersistentConversationHelper persistentConversationHelper;


public Conversation beginConversation(ConversationParameters conversationParameters)
        throws ConversationException {

    ConversationId convId = new SimpleConversationId(UUID.randomUUID());
    persistentConversationHelper.createConversation(new PersistentConversation(convId, conversationParameters.getName()));

    return getConversation(convId);
}

public Conversation getConversation(ConversationId id) throws ConversationException {
    if (PersistentConversationHolder.holdsConversation(id)) {
        // we already loaded the conversation for the calling thread
        return PersistentConversationHolder.getConversation(id);
    }
    else {
        // load the conversation
        com.csc.cscip.ux.model.WebFlowConversation webFlowConversation = persistentConversationHelper.readConversation(id);
        **if (webFlowConversation == null) {                
            throw new NoSuchConversationException(id);
        }**

        PersistentConversation conversation = new PersistentConversation(webFlowConversation);

        // cache it for the calling thread
        PersistentConversationHolder.putConversation(conversation);
        return conversation;            
    }
}

日志跟踪中的异常:

2014-09-10 13:17:33,318 [http-bio-9090-exec-9] DEBUG org.springframework.webflow.scope.RequestScope  - Returning scoped instance 'httpServletResponse'
2014-09-10 13:17:33,999 [http-bio-9090-exec-9] ERROR com.csc.cscip.ux.common.webflow.persistance.PersistentConversationManager  - [ exception code < 2MFC3 > thrown < getConversation > exception message No conversation could be found with id '5e06bded-e3e4-42a5-8f70-f69c59f42ba6' 

- 也许这次谈话已经结束了?用params 5e06bded-e3e4-42a5-8f70-f69c59f42ba6,] org.springframework.webflow.conversation.NoSuchConversationException: No conversation could be found with id '5e06bded-e3e4-42a5-8f70-f69c59f42ba6' - 也许这次谈话已经结束了?

目前我正在尝试重新启动流程,当我收到NoSuchConversationException异常但无法成功时:(

现在我该如何处理这个问题/场景?

0 个答案:

没有答案