Announcement Announcement Module
Collapse
No announcement yet.
Exception handling in Spring webflow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception handling in Spring webflow

    Hi

    Currently we are using Spring webflow in our application and the exception handling is basically done using Spring MVC handler (HandlerExceptionResolver).

    The problem is, if in case we want to log the 'view-state name' or 'handler (webflow action name)' from which the error has occurred is not possible because the exception handler is in Spring MVC. Even in case if we use the 'handler.getClass()' to log the action name, it is giving the entry point of the webflow which is 'FlowController' and not giving an idea from which webflow action the problem is happening.

    Because, in our application we are seeing quite a number of 'LockTimeoutException: Unable to acquire conversation lock after 30 seconds', and we want to get a pattern of this error occurrence. Any advice is highly appreciated. Thanks.

    Reg,
    Sam

  • #2
    You could try catching the exception in your flow, and then examine the state of the flow. I'm not sure what information can be determined once you catch the exception but at least if you do it inside the flow then the flow state should still exist.

    We use the below snippet to catch all uncaught exceptions and then email (inside an action) to operations.

    Code:
     
    <!-- GLOBAL TRANSITIONS -->
        <global-transitions>
            <transition on="cancel" to="cancelledOperation"
                validate="false" />
            <transition on-exception="java.lang.RuntimeException"
                to="catchError" />
        </global-transitions>
    
        <!-- ACTION STATE FOR ERROR NOTIFICATION -->
        <action-state id="catchError">
            <evaluate expression="actions.reportError" />
            <transition to="error" />
        </action-state>

    Comment


    • #3
      I tryed added the:

      <!-- GLOBAL TRANSITIONS -->
      <global-transitions>
      <transition on="cancel" to="cancelledOperation"
      validate="false" />
      <transition on-exception="java.lang.RuntimeException"
      to="catchError" />
      </global-transitions>

      and once I do that I get a error in my XML

      Comment

      Working...
      X