Results 1 to 3 of 3

Thread: Exception handling in Spring webflow

  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Default 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. #2
    Join Date
    Jul 2011
    Location
    Palo Alto
    Posts
    8

    Default

    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>

  3. #3
    Join Date
    Mar 2011
    Posts
    166

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •