Announcement Announcement Module
No announcement yet.
handling end states Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    SpringWebFlowExceptionResolver can not be used with Struts

    Hi Wang,

    What Michael Clark pointed out about configuring a ContextLoaderPlugIn is correct. Doing so will solve your NullPointerException issue; however, this will not help you with your initial problem.

    The bad news for you is that my earlier assumption was correct: you can not directly use the SpringWebFlowExceptionResolver in conjunction with Struts.

    The reason is that SpringWebFlowExceptionResolver is a HandlerExceptionResolver which is called by Spring's DispatcherServlet in its processHandlerException() method. Since you are using Struts, a Struts ActionServlet is responsible for handling your request. Thus any exceptions thrown will never be handled by a HandlerExceptionResolver and must therefore be handled by the Struts framework (for example, by implementing a custom Struts ExceptionHandler as I mentioned earlier).

    Another possible option would be to override the execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) method of SWF's FlowAction and add a try-catch block around the calls into the SWF framework code. You could then decide how to handle the exception yourself, perhaps in a manner similar to the SpringWebFlowExceptionResolver implementation.

    Hope this helps!

    And if you develop a custom exception handling solution for use with Struts+SWF, please post it back here in the forum or on Jira, as I'm sure the rest of the community would appreciate it.




    • #32
      SpringWebFlowExceptionResolver support for SWF 1.0.x

      For those of you (still) following this thread and using my SpringWebFlowExceptionResolver, I have uploaded a new release with support for SWF 1.0.x. See the new thread here:




      • #33
        SpringWebFlowExceptionResolver & multiple FlowControllers for a single flowExecutor

        Hi sre786,

        I realize that this is a rather belated reply; however, I hope you still find it helpful...

        Originally posted by sre786 View Post
        Thanks for providing the code.
        You're very welcome!

        Originally posted by sre786 View Post
        I copied the code and tried to get it working but I have a problem. May be I am missing something here... If I have multiple flows ... i can't set a defaultFlowId for my FlowExecutor and _flowId parameter is not passed around in the URL once the flow kicks-off.... how do I extract what flow to start from available info ?(which seems to be just the expired _flowExecutionKey)?
        These are some good points you raise.
        • Due to the current limitations of SWF, there is no way to determine the flowId from the conversation and/or flow execution keys for an expired flow. Thus if you cannot configure a defaultFlowId, it does not make sense to use the SpringWebFlowExceptionResolver.
        • A viable option is to use multiple FlowControllers, one configured for each flow with a specific path and corresponding defaultFlowId. Each of these FlowControllers could reference the same flowExecutor. Thus, you would essentially have one central repository (i.e., flowRegistry), but you would have multiple, unique entry points into the various flows. This would allow SpringWebFlowExceptionResolver to restart the correct flow based merely on the path and configured defaultFlowId per FlowController.

        Does that make sense?


        p.s. in case you are still using the code from 2006, you might want to check out the latest release:


        • #34
          Hi Sam,

          I am using your "Custom SimpleMappingExceptionResolver"..

          But when am getting "org.springframework.webflow.execution.repository. NoSuchFlowExecutionException"

          The debugger is not reaching this class.

          I have configured the beans as u mentioned ..

          How Spring is registering " SpringWebFlowExceptionResolver"?


          • #35
            I have configured globalExceptionResolver.

            I am using Spring webflow + Spring MVC.

            Exceptions are not reaching globalExceptionResolver..

            How do I need to configure globalExceptionResolver?

            Do i need to refer it from some other bean???


            • #36
              Hi Sudheesh,

              Originally posted by Sudheesh View Post
              How Spring is registering " SpringWebFlowExceptionResolver"?
              Spring's DispatcherServlet will automatically detect any HandlerExceptionResolvers registered in the ApplicationContext of your web application. Thus, its mere presence should ensure that it is registered. Note, however, that the resolvers will be sorted according to their configured ordering (i.e., via the Ordered interface, which SimpleMappingExceptionResolver implements). In addition, you must configure the FlowDefinitionRegistry for a SpringWebFlowExceptionResolver as I mentioned in the JIRA here:


              As of version 1.9, SpringWebFlowExceptionResolver requires that you manually configure
              a FlowDefinitionRegistry as follows:

              <bean id="springWebFlowExceptionResolver" class="">
                  <property name="flowDefinitionRegistry" ref="flowRegistry" />

              Last edited by Sam Brannen; May 26th, 2008, 08:39 AM.


              • #37
                Thanks Sam,

                This post has helped me a lot

                I think following thread is also some what related.


                Thanks once again,


                • #38
                  this exception handling strategy is implemented with Spring?
                  Or other way to implement this?
                  Last edited by eros; Mar 17th, 2010, 08:29 PM.