Announcement Announcement Module
Collapse
No announcement yet.
Error handling - global error channel Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error handling - global error channel

    Hi all,
    I am new in Spring integration, and I want to test error handling with the following scenario:
    1. A client send an order (O) to a front end web service A,
    2. This web service A, get information from a web service B to enrich O,
    3. There is a data mapping to create a new order O1
    4. Then, this order O1 is send to a back end web service C,
    5. Voluntary, C throws a WebServiceException.


    I want to handle all exception with the global errorChannel.
    I create all channels with "queue" sub element to make them pollable as explained in Spring integration documentation, but the exception is never catched in the errorChannel.
    Can someone have a look on my code and explain me where is my error.
    Thanks in advance,
    Best regards
    Mta38

    My configuration:
    Eclipse,
    Java Jdk 1.5
    Spring Integration 1.0.2
    Spring framework 2.5.5

  • #2
    I have no direct reply to your situation but I will make a comment about your XML namespace config.
    This may not have an effect on your setup anyway.

    You are using integration as the default namespace and so there is no need to declare it again.

    I think you have duplicated by using
    Code:
    	xmlns:integration="http://www.springframework.org/schema/integration"

    Comment


    • #3
      I have no time to reproduce with a simplified configuration at the moment unfortunately. I didn't spot any obvious mistakes at a first glance. Could you try to reproduce this in a simple testcase (and create a JIRA from it if you can)?

      Again, I'd love to dig into this a bit, but you don't want to hold your breath until I have time for that. Business first, unfortunately

      Comment


      • #4
        I'm pretty sure your Messages are probably going to the channel you created called "defaultErrorChannel" (i.e. they're not matching the one Exception type that you explicitly mapped).

        It looks like you don't have any endpoint receiving messages from the "defaultErrorChannel". Try adding something with that as its "input-channel" and see if that's where your messages are going.

        Hope that helps.
        -Mark

        Comment


        • #5
          I create all channels with "queue" sub element to make them pollable as explained in Spring integration documentation,
          but the exception is never catched in the errorChannel.
          It appears that the only reason you have made your channels pollable
          is so that you can direct exceptions to the error channel.

          That has, to me, the effect of making your configuration overly complex.

          Wouldn't you rather have direct channels and handle exceptions in your business logic?

          Comment


          • #6
            I Mark,
            Thanks for your answer.
            I added a handler with defaultErrorChannel, but the result is the same. The code of the error handler is not executed.
            As Hicyo said in his post http://forum.springsource.org/showthread.php?t=63715, errorchannel seems does not catch the Exception.

            This is my trace that prove WebServiceException is raised

            org.springframework.integration.message.MessageHan dlingException: error occurred in message handler [ServiceActivator for [org.springframework.integration.handler.MessageMap pingMethodInvoker@55d4d1]]
            at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:54)
            at org.springframework.integration.endpoint.PollingCo nsumer.doPoll(PollingConsumer.java:59)
            at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.innerPoll(AbstractPollingEnd point.java:232)
            at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.poll(AbstractPollingEndpoint .java:216)
            at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.run(AbstractPollingEndpoint. java:209)
            at org.springframework.integration.scheduling.SimpleT askScheduler$ErrorHandlingRunnableWrapper.run(Simp leTaskScheduler.java:307)
            at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:417)
            at java.util.concurrent.FutureTask$Sync.innerRunAndRe set(FutureTask.java:280)
            at java.util.concurrent.FutureTask.runAndReset(Future Task.java:135)
            at org.springframework.integration.scheduling.SimpleT askScheduler$TriggeredTask.run(SimpleTaskScheduler .java:256)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:650)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:675)
            at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.xml.ws.WebServiceException: WebServiceException - [CRISTAL BACK]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

            mta38

            Comment

            Working...
            X