Results 1 to 9 of 9

Thread: Error Channel Behavior

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Charlotte NC
    Posts
    10

    Default Error Channel Behavior

    We are deploying a spring component that uses Spring Integration in JBoss. We have resitered an error channel and error listener.
    When we undeploy a war file, Jboss classloading seems to unload a logger class and cause an NPE to be thrown and this gets picked up on the MessagePublishingErrorHandler. Trying to log the message causes another exception that gets caugth etc.
    This is an easy error to reporduce - the thread that the error listener runs in cannot throw exception without taking us on a never ending loop (until we terminate the VM).

    We need a solution to this issue.
    Thanks,
    Caroline.

  2. #2
    Join Date
    Jan 2008
    Location
    Charlotte NC
    Posts
    10

    Default Similar to deploy/undeploy

    THis error is tied into the deploy/undeploy error in a separate thread.

    Thanks,
    Caroline.

  3. #3
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Caroline,

    Is the MessageHandler referenced by the endpoint that is subscribed to the 'errorChannel' an implementation of the MessageHandler interface, or is it delegating to a simple Object (or using annotations)?

    If it is an actual MessageHandler implementation, can you try/catch *any* exception within it's handle method? (maybe just print the stack trace for now). If I understand the problem correctly, then we need to always set a no-op (not even logging) errorHandler on any handler that is itself subscribed to the 'errorChannel'?

    Thanks,
    -Mark

  4. #4
    Join Date
    Jan 2008
    Location
    Charlotte NC
    Posts
    10

    Default Error Channel configuration

    Mark,
    here is the configuration that we use:

    <endpoint input-channel="errorChannel"
    default-output-channel="outputChannel"
    handler-ref="errorListener"
    handler-method="handle"/>

    <beans:bean id="errorListener" class="com.wachovia.cib.gfits.integration.handler. error.ErrorListener"/>

    Our error listener has a set of observers that it passes the error to.

    Fairly simple stuff.

    So if you skip the observer step - and throw a RTE in teh listener - you should be able to reproduce this behavior.

    Thanks,
    Caroline.

  5. #5
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Thank you Caroline.

    I am about to commit a change that breaks the endless loop for an error thrown in an error handler. I'll first see if I can reproduce with this same scenario.

    Thanks,
    Mark

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Caroline,

    I have committed a change in the MessageBus such that the MessagePublishingErrorHandler is not set as the default 'errorHandler' for any listener on the "errorChannel".

    Note that the errors will be logged, but not sent back to the error channel. So you should only see warn-level logging for an error thrown from the handler that is listening to the errorChannel.

    This change is available on the SVN HEAD and will be in tonight's snapshot. If you get a chance to test it please let me know if your problem is resolved.

    Also, as a short term solution, you should be able to add the "error-handler" attribute to your <endpoint/> and provide a reference to a bean that implements ErrorHandler as a no-op or only logs. For example:
    Code:
    <endpoint input-channel="errorChannel"
                  default-output-channel="outputChannel"
                  handler-ref="errorListener"
                  handler-method="handle"
                  error-handler="loggingOnlyErrorHandler/>
    Thanks,
    Mark

Posting Permissions

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