FAQ
Hi All,
I have written a file route which picks up xml files from a specified
location. This file is passed to a splitter (actually an Expression written
by me) which returns a custom made Iterator and returns to Camel. When camel
is iterating through my iterator, if I throw RuntimeException, it is not
getting caught in global exception and hence i am not able to log the error.

In actual, my entire code is a test class attached with this mail. Anyone
can run it directly. There is one strange behavior also noticed by me. If i
throw RuntimeException from the Expression written by me, it is properly
caught by the global exception. You can find both the occurance of
RuntimeException in the code (the commented one is working properly).

Any help will be appreciated.

http://camel.465427.n5.nabble.com/file/n4826097/SplitInProgressTest.java
SplitInProgressTest.java


Regards,
Nilesh Soni
http://camel.465427.n5.nabble.com/file/n4826097/SampleEventFile.event
SampleEventFile.event

Search Discussions

  • Claus Ibsen at Sep 21, 2011 at 12:07 pm
    Hi

    What version of Camel are you using?

    I think we have fixed this in either 2.9 or one of the latest releases.

    On Wed, Sep 21, 2011 at 2:04 PM, nilsoni wrote:
    Hi All,
    I have written a file route which picks up xml files from a specified
    location. This file is passed to a splitter (actually an Expression written
    by me) which returns a custom made Iterator and returns to Camel. When camel
    is iterating through my iterator, if I throw RuntimeException, it is not
    getting caught in global exception and hence i am not able to log the error.

    In actual, my entire code is a test class attached with this mail. Anyone
    can run it directly. There is one strange behavior also noticed by me. If i
    throw RuntimeException from the Expression written by me, it is properly
    caught by the global exception. You can find both the occurance of
    RuntimeException in the code (the commented one is working properly).

    Any help will be appreciated.

    http://camel.465427.n5.nabble.com/file/n4826097/SplitInProgressTest.java
    SplitInProgressTest.java


    Regards,
    Nilesh Soni
    http://camel.465427.n5.nabble.com/file/n4826097/SampleEventFile.event
    SampleEventFile.event

    --
    View this message in context: http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4826097.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Nilsoni at Sep 21, 2011 at 4:37 pm
    I am using version 2.8.0 and i have also tested the code with version 2.8.1.
    When 2.9.0 is scheduled to be released?
  • Nilsoni at Sep 21, 2011 at 6:03 pm
    Hi,
    Now i have tried with version 2.9.0-SNAPSHOT also but it's still not
    working. What's the solution/workaround?

    Regards,
    Nilesh Soni
  • Claus Ibsen at Sep 23, 2011 at 4:15 pm
    Hi

    I had a bit time right now and will look into it. I have reproduce the
    issue and have a pending fix.
    Fell free to create a JIRA ticket, a I am about to rush out the door
    for the weekend.

    On Wed, Sep 21, 2011 at 2:04 PM, nilsoni wrote:
    Hi All,
    I have written a file route which picks up xml files from a specified
    location. This file is passed to a splitter (actually an Expression written
    by me) which returns a custom made Iterator and returns to Camel. When camel
    is iterating through my iterator, if I throw RuntimeException, it is not
    getting caught in global exception and hence i am not able to log the error.

    In actual, my entire code is a test class attached with this mail. Anyone
    can run it directly. There is one strange behavior also noticed by me. If i
    throw RuntimeException from the Expression written by me, it is properly
    caught by the global exception. You can find both the occurance of
    RuntimeException in the code (the commented one is working properly).

    Any help will be appreciated.

    http://camel.465427.n5.nabble.com/file/n4826097/SplitInProgressTest.java
    SplitInProgressTest.java


    Regards,
    Nilesh Soni
    http://camel.465427.n5.nabble.com/file/n4826097/SampleEventFile.event
    SampleEventFile.event

    --
    View this message in context: http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4826097.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Davis Ford at Sep 23, 2011 at 7:21 pm
    Hi, I'm using the camel proxy feature to inject a proxy interface into my class for remoting.

    Example:

    <!-- camel JMS Producer: can send messages to ActiveMQ server -->
    <bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="${camel.broker.url}" />
    </bean>

    <bean id="myBean" name="myBean" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
    <property name="serviceUrl" value="jms:queue:incoming" />
    <property name="serviceInterface" value="com.example.MyBeanInterface" />
    </bean>

    So, in deployment the server will be on a remote node. I can wire up a test case like this:

    @ContextConfiguration(locations={"classpath:applicationContext.xml"})
    @RunWith(SpringJUnit4ClassRunner.class)
    public class MyTest {

    @Resource(name="myBean") MyBeanInterface bean;

    @Test
    public void test() throws Exception {
    String retval = bean.callSomeMethod();
    }
    }

    So, this all works if the AMQ JMS server is up and running, but what I want to do is have it test instead against the camel mock endpoint, but it isn't clear to me exactly how I can do this. The examples I've seen don't tend to talk about the CamelProxyFactoryBean so much.

    What I'd like to do is when my test calls:

    String retval = bean.callSomeMethod();

    I want it to go against the camel mock endpoint and then return a value I specify (this is using the JMS InOut pattern).

    Can someone show me a clean way to accomplish that?
  • Davis Ford at Sep 23, 2011 at 8:39 pm
    Let me try a different approach to this question. I'm now injecting a mock:url into the endpoints so this seems like it should work but it doesn't...

    <bean id="myBean" name="myBean" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
    <property name="serviceUrl" value="mock:queue.incoming" />
    <property name="serviceInterface" value="com.example.MyBeanInterface" />
    </bean>

    @ContextConfiguration(locations={"classpath:applicationContext.xml"})
    @RunWith(SpringJUnit4ClassRunner.class)
    public class MyTest extends CamelTestSupport {

    @Resource(name="myBean") MyBeanInterface bean;

    MockEndpoint mockEndpoint;

    @Before
    public void setUp() throws Exception {
    super.setUp();
    mockEndpoint = getMockEndpoint("mock:queue.incoming");
    mockEndpoint.expectedMessageCount(1);
    }

    @Test
    public void test() throws Exception {
    String retval = bean.callSomeMethod();
    mockEndpoint.assertIsSatisfied();
    }
    }

    The test fails indicating that 1 message was expected but zero were received. I'm not 100% certain why that is -- perhaps it has to do with the test subclassing CamelTestSupport but using spring's JUnit 4 test runner, so maybe they are two different camel context's ? i.e. one loaded in spring, and the other instantiated by CamelTestSupport itself?

    Any ideas?

    -----Original Message-----
    From: Davis Ford
    Sent: Friday, September 23, 2011 3:20 PM
    To: users@camel.apache.org
    Subject: testing camel proxy with a mock camel endpoint?
  • Davis Ford at Sep 23, 2011 at 9:09 pm
    Removing the subclass for CamelTestSupport and instead doing

    mockEndpoint = camelContext.getEndpoint("mock:queue.incoming");

    fixes the issue.

    -----Original Message-----
    From: Davis Ford
    Sent: Friday, September 23, 2011 4:39 PM
    To: users@camel.apache.org
    Subject: RE: testing camel proxy with a mock camel endpoint?

    Let me try a different approach to this question. I'm now injecting a mock:url into the endpoints so this seems like it should work but it doesn't...

    <bean id="myBean" name="myBean" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
    <property name="serviceUrl" value="mock:queue.incoming" />
    <property name="serviceInterface" value="com.example.MyBeanInterface" />
    </bean>

    @ContextConfiguration(locations={"classpath:applicationContext.xml"})
    @RunWith(SpringJUnit4ClassRunner.class)
    public class MyTest extends CamelTestSupport {

    @Resource(name="myBean") MyBeanInterface bean;

    MockEndpoint mockEndpoint;

    @Before
    public void setUp() throws Exception {
    super.setUp();
    mockEndpoint = getMockEndpoint("mock:queue.incoming");
    mockEndpoint.expectedMessageCount(1);
    }

    @Test
    public void test() throws Exception {
    String retval = bean.callSomeMethod();
    mockEndpoint.assertIsSatisfied();
    }
    }

    The test fails indicating that 1 message was expected but zero were received. I'm not 100% certain why that is -- perhaps it has to do with the test subclassing CamelTestSupport but using spring's JUnit 4 test runner, so maybe they are two different camel context's ? i.e. one loaded in spring, and the other instantiated by CamelTestSupport itself?

    Any ideas?

    -----Original Message-----
    From: Davis Ford
    Sent: Friday, September 23, 2011 3:20 PM
    To: users@camel.apache.org
    Subject: testing camel proxy with a mock camel endpoint?
  • Claus Ibsen at Sep 24, 2011 at 6:34 am

    On Fri, Sep 23, 2011 at 11:08 PM, Davis Ford wrote:
    Removing the subclass for CamelTestSupport and instead doing

    mockEndpoint = camelContext.getEndpoint("mock:queue.incoming");
    Ah you are using Spring Testing (eg those two @ annotations) on your class.
    And therefore you need to IoC the stuff you need.

    Alternatively there is a CamelSpringTestSupport that is suitable for
    testing with Camel + Spring.

    fixes the issue.

    -----Original Message-----
    From: Davis Ford
    Sent: Friday, September 23, 2011 4:39 PM
    To: users@camel.apache.org
    Subject: RE: testing camel proxy with a mock camel endpoint?

    Let me try a different approach to this question.  I'm now injecting a mock:url into the endpoints so this seems like it should work but it doesn't...

    <bean id="myBean" name="myBean" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
    <property name="serviceUrl" value="mock:queue.incoming" />
    <property name="serviceInterface" value="com.example.MyBeanInterface" />
    </bean>

    @ContextConfiguration(locations={"classpath:applicationContext.xml"})
    @RunWith(SpringJUnit4ClassRunner.class)
    public class MyTest extends CamelTestSupport {

    @Resource(name="myBean") MyBeanInterface bean;

    MockEndpoint mockEndpoint;

    @Before
    public void setUp() throws Exception {
    super.setUp();
    mockEndpoint = getMockEndpoint("mock:queue.incoming");
    mockEndpoint.expectedMessageCount(1);
    }

    @Test
    public void test() throws Exception {
    String retval = bean.callSomeMethod();
    mockEndpoint.assertIsSatisfied();
    }
    }

    The test fails indicating that 1 message was expected but zero were received.  I'm not 100% certain why that is -- perhaps it has to do with the test subclassing CamelTestSupport but using spring's JUnit 4 test runner, so maybe they are two different camel context's ? i.e. one loaded in spring, and the other instantiated by CamelTestSupport itself?

    Any ideas?

    -----Original Message-----
    From: Davis Ford
    Sent: Friday, September 23, 2011 3:20 PM
    To: users@camel.apache.org
    Subject: testing camel proxy with a mock camel endpoint?


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Claus Ibsen at Sep 24, 2011 at 7:50 am
    Hi

    I have created a ticket
    https://issues.apache.org/jira/browse/CAMEL-4482
    On Fri, Sep 23, 2011 at 6:14 PM, Claus Ibsen wrote:
    Hi

    I had a bit time right now and will look into it. I have reproduce the
    issue and have a pending fix.
    Fell free to create a JIRA ticket, a I am about to rush out the door
    for the weekend.

    On Wed, Sep 21, 2011 at 2:04 PM, nilsoni wrote:
    Hi All,
    I have written a file route which picks up xml files from a specified
    location. This file is passed to a splitter (actually an Expression written
    by me) which returns a custom made Iterator and returns to Camel. When camel
    is iterating through my iterator, if I throw RuntimeException, it is not
    getting caught in global exception and hence i am not able to log the error.

    In actual, my entire code is a test class attached with this mail. Anyone
    can run it directly. There is one strange behavior also noticed by me. If i
    throw RuntimeException from the Expression written by me, it is properly
    caught by the global exception. You can find both the occurance of
    RuntimeException in the code (the commented one is working properly).

    Any help will be appreciated.

    http://camel.465427.n5.nabble.com/file/n4826097/SplitInProgressTest.java
    SplitInProgressTest.java


    Regards,
    Nilesh Soni
    http://camel.465427.n5.nabble.com/file/n4826097/SampleEventFile.event
    SampleEventFile.event

    --
    View this message in context: http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4826097.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Nilsoni at Nov 27, 2011 at 2:28 pm
    Hi Clause,
    It seems that this issue is not yet resolved. Can you please try the code
    uploaded by me in the nabble
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-td4826097.htmlTry
    the file SplitInProgress.java


    The exception is still uncaught by the clause
    onException(Throwable.class)
    .process(customMoveFailed());
    On Sat, Sep 24, 2011 at 1:20 PM, Claus Ibsen-2 [via Camel] wrote:

    Hi

    I have created a ticket
    https://issues.apache.org/jira/browse/CAMEL-4482

    On Fri, Sep 23, 2011 at 6:14 PM, Claus Ibsen <[hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=0>>
    wrote:
    Hi

    I had a bit time right now and will look into it. I have reproduce the
    issue and have a pending fix.
    Fell free to create a JIRA ticket, a I am about to rush out the door
    for the weekend.


    On Wed, Sep 21, 2011 at 2:04 PM, nilsoni <[hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=1>>
    wrote:
    Hi All,
    I have written a file route which picks up xml files from a specified
    location. This file is passed to a splitter (actually an Expression
    written
    by me) which returns a custom made Iterator and returns to Camel. When
    camel
    is iterating through my iterator, if I throw RuntimeException, it is
    not
    getting caught in global exception and hence i am not able to log the
    error.
    In actual, my entire code is a test class attached with this mail.
    Anyone
    can run it directly. There is one strange behavior also noticed by me.
    If i
    throw RuntimeException from the Expression written by me, it is
    properly
    caught by the global exception. You can find both the occurance of
    RuntimeException in the code (the commented one is working properly).

    Any help will be appreciated.
    http://camel.465427.n5.nabble.com/file/n4826097/SplitInProgressTest.java
    SplitInProgressTest.java


    Regards,
    Nilesh Soni
    http://camel.465427.n5.nabble.com/file/n4826097/SampleEventFile.event
    SampleEventFile.event

    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4826097.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=2>
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=3>
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    ------------------------------
    If you reply to this email, your message will be added to the discussion
    below:

    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4836157.html
    To unsubscribe from Global exception not invoked in case of Exception
    fired while iterating through File Splitter, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4826097&code=bmlsc29uaUBnbWFpbC5jb218NDgyNjA5N3wtMzAwMjQxMDg1>.


    --
    Regards,
    Nilesh Soni


    --
    View this message in context: http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p5026545.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Claus Ibsen at Nov 27, 2011 at 4:59 pm
    You need to handle the exception in the onException.

    On Sun, Nov 27, 2011 at 3:28 PM, nilsoni wrote:
    Hi Clause,
    It seems that this issue is not yet resolved. Can you please try the code
    uploaded by me in the nabble
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-td4826097.htmlTry
    the file SplitInProgress.java


    The exception is still uncaught by the clause
    onException(Throwable.class)
    .process(customMoveFailed());

    On Sat, Sep 24, 2011 at 1:20 PM, Claus Ibsen-2 [via Camel] <
    ml-node+s465427n4836157h47@n5.nabble.com> wrote:
    Hi

    I have created a ticket
    https://issues.apache.org/jira/browse/CAMEL-4482

    On Fri, Sep 23, 2011 at 6:14 PM, Claus Ibsen <[hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=0>>
    wrote:
    Hi

    I had a bit time right now and will look into it. I have reproduce the
    issue and have a pending fix.
    Fell free to create a JIRA ticket, a I am about to rush out the door
    for the weekend.


    On Wed, Sep 21, 2011 at 2:04 PM, nilsoni <[hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=1>>
    wrote:
    Hi All,
    I have written a file route which picks up xml files from a specified
    location. This file is passed to a splitter (actually an Expression
    written
    by me) which returns a custom made Iterator and returns to Camel. When
    camel
    is iterating through my iterator, if I throw RuntimeException, it is
    not
    getting caught in global exception and hence i am not able to log the
    error.
    In actual, my entire code is a test class attached with this mail.
    Anyone
    can run it directly. There is one strange behavior also noticed by me.
    If i
    throw RuntimeException from the Expression written by me, it is
    properly
    caught by the global exception. You can find both the occurance of
    RuntimeException in the code (the commented one is working properly).

    Any help will be appreciated.
    http://camel.465427.n5.nabble.com/file/n4826097/SplitInProgressTest.java
    SplitInProgressTest.java


    Regards,
    Nilesh Soni
    http://camel.465427.n5.nabble.com/file/n4826097/SampleEventFile.event
    SampleEventFile.event

    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4826097.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=2>
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=4836157&i=3>
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    ------------------------------
    If you reply to this email, your message will be added to the discussion
    below:

    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4836157.html
    To unsubscribe from Global exception not invoked in case of Exception
    fired while iterating through File Splitter, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4826097&code=bmlsc29uaUBnbWFpbC5jb218NDgyNjA5N3wtMzAwMjQxMDg1>.


    --
    Regards,
    Nilesh Soni


    --
    View this message in context: http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p5026545.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/
  • Nilesh Soni at Mar 4, 2012 at 2:34 pm
    Hi Clause,
    I am writing this mail once again because i feel that issue no 4482 is not
    resolved yet. I am attaching the test case written by you/your team member.
    I feel that streaming() is the main culprit because of which the exception
    is not getting caught. Please run the attached test case as it is and it
    will be failed. To make it pass, just comment the .streaming() method and
    the test case will pass. Please let me know in case I am wrong.

    Regards,
    Nilesh Soni

    On Sun, Nov 27, 2011 at 10:28 PM, Claus Ibsen wrote:

    You need to handle the exception in the onException.

    On Sun, Nov 27, 2011 at 3:28 PM, nilsoni wrote:
    Hi Clause,
    It seems that this issue is not yet resolved. Can you please try the code
    uploaded by me in the nabble
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-td4826097.htmlTry
    the file SplitInProgress.java


    The exception is still uncaught by the clause
    onException(Throwable.class)
    .process(customMoveFailed());

    On Sat, Sep 24, 2011 at 1:20 PM, Claus Ibsen-2 [via Camel] <
    ml-node+s465427n4836157h47@n5.nabble.com> wrote:
    Hi

    I have created a ticket
    https://issues.apache.org/jira/browse/CAMEL-4482

    On Fri, Sep 23, 2011 at 6:14 PM, Claus Ibsen <[hidden email]<
    http://user/SendEmail.jtp?type=node&node=4836157&i=0>>
    wrote:
    Hi

    I had a bit time right now and will look into it. I have reproduce the
    issue and have a pending fix.
    Fell free to create a JIRA ticket, a I am about to rush out the door
    for the weekend.


    On Wed, Sep 21, 2011 at 2:04 PM, nilsoni <[hidden email]<
    http://user/SendEmail.jtp?type=node&node=4836157&i=1>>
    wrote:
    Hi All,
    I have written a file route which picks up xml files from a specified
    location. This file is passed to a splitter (actually an Expression
    written
    by me) which returns a custom made Iterator and returns to Camel.
    When
    camel
    is iterating through my iterator, if I throw RuntimeException, it is
    not
    getting caught in global exception and hence i am not able to log the
    error.
    In actual, my entire code is a test class attached with this mail.
    Anyone
    can run it directly. There is one strange behavior also noticed by
    me.
    If i
    throw RuntimeException from the Expression written by me, it is
    properly
    caught by the global exception. You can find both the occurance of
    RuntimeException in the code (the commented one is working properly).

    Any help will be appreciated.
    http://camel.465427.n5.nabble.com/file/n4826097/SplitInProgressTest.java
    SplitInProgressTest.java


    Regards,
    Nilesh Soni
    http://camel.465427.n5.nabble.com/file/n4826097/SampleEventFile.event
    SampleEventFile.event

    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4826097.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: [hidden email]<
    http://user/SendEmail.jtp?type=node&node=4836157&i=2>
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: [hidden email]<
    http://user/SendEmail.jtp?type=node&node=4836157&i=3>
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    ------------------------------
    If you reply to this email, your message will be added to the
    discussion
    below:
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p4836157.html
    To unsubscribe from Global exception not invoked in case of Exception
    fired while iterating through File Splitter, click here<
    http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4826097&code=bmlsc29uaUBnbWFpbC5jb218NDgyNjA5N3wtMzAwMjQxMDg1
    .


    --
    Regards,
    Nilesh Soni


    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Global-exception-not-invoked-in-case-of-Exception-fired-while-iterating-through-File-Splitter-tp4826097p5026545.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --
    Claus Ibsen
    -----------------
    FuseSource
    Email: cibsen@fusesource.com
    Web: http://fusesource.com
    Twitter: davsclaus, fusenews
    Blog: http://davsclaus.blogspot.com/
    Author of Camel in Action: http://www.manning.com/ibsen/


    --
    Regards,
    Nilesh Soni

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedSep 21, '11 at 12:05p
activeMar 4, '12 at 2:34p
posts13
users3
websitecamel.apache.org

People

Translate

site design / logo © 2022 Grokbase