You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ncsibra <No...@epam.com> on 2016/09/21 13:50:40 UTC

weaveAddFirst doesn't work correctly with route level onException

Hi,

I'm using camel version 2.17.1 and I have some problem with the
weaveAddFirst method.
When a route level onException clause exist and only one advice added or
multiple advice added, but the first one contains the weaveAddFirst method,
then camel will throw an exception:

"java.lang.IllegalArgumentException: There are no outputs which matches: *
in the route: Route(exceptionFirst)[[From[direct:exceptionFirst]] ->
[OnException[[class java.lang.Exception] ->
[process[Processor@0x49438269]]], process[Processor@0xba2f4ec]]]"

Attached a single junit test file, I'm able to reproduce the bug with this
in the mentioned camel version and even in the latest one(2.17.3) too.
OnExceptionTest.java
<http://camel.465427.n5.nabble.com/file/n5787900/OnExceptionTest.java>  



--
View this message in context: http://camel.465427.n5.nabble.com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-tp5787900.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by Brad Johnson <br...@mediadriver.com>.
Excellent! Congratulations.

On Tue, Sep 27, 2016 at 1:18 AM, ncsibra <No...@epam.com> wrote:

> Yes, changed the method call order. :D
> We are doing several weave* calls, just put a weaveById first, then it
> works
> fine.
> Actually, in our case, we have to put it last to be sure that our advice is
> the last(actually the first :)), so it's not just a hack.
> Anyway, I may report a bug on their issue tracker as far as I see, they
> don't really check this thread.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-
> tp5787900p5788085.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by ncsibra <No...@epam.com>.
Yes, changed the method call order. :D
We are doing several weave* calls, just put a weaveById first, then it works
fine.
Actually, in our case, we have to put it last to be sure that our advice is
the last(actually the first :)), so it's not just a hack.
Anyway, I may report a bug on their issue tracker as far as I see, they
don't really check this thread.



--
View this message in context: http://camel.465427.n5.nabble.com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-tp5787900p5788085.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by Brad Johnson <br...@mediadriver.com>.
Were you able to finally get it to work correctly?

On Mon, Sep 26, 2016 at 1:10 AM, ncsibra <No...@epam.com> wrote:

> Yes, weaveById works fine, but in my case I use it in a base class, used by
> almost every integration test and those tests are able to modify the route
> too before start, so I can't be sure that my originally first node is
> really
> still the first after the child test set up phase, that's why I used and
> prefer the weaveAddFirst method.
> And every integration test using a different route with different ids, so a
> general solution with weaveAddFirst is better in my case.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-
> tp5787900p5788046.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by ncsibra <No...@epam.com>.
Yes, weaveById works fine, but in my case I use it in a base class, used by
almost every integration test and those tests are able to modify the route
too before start, so I can't be sure that my originally first node is really
still the first after the child test set up phase, that's why I used and
prefer the weaveAddFirst method.
And every integration test using a different route with different ids, so a
general solution with weaveAddFirst is better in my case.



--
View this message in context: http://camel.465427.n5.nabble.com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-tp5787900p5788046.html
Sent from the Camel - Users mailing list archive at Nabble.com.

weaveAddFirst doesn't work correctly with route level onException

Posted by Minh Tran <da...@gmail.com>.
Hi

I use the advice stuff quite extensively but never weaveAddFirst though. I
do see the kind of exceptions you are seeing from time to time and it's
probably a bug.

I generally find the workaround is to use weaveById. I think it has a lot
less trouble finding the node to weave at if you just give it the precise
id.

On Friday, 23 September 2016, ncsibra <No...@epam.com> wrote:

> Can somebody confirm that am I doing something wrong or is this really a
> bug?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/weaveAddFirst-doesn-t-work-correctly-with-route-level-on
> Exception-tp5787900p5787949.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by ncsibra <No...@epam.com>.
Thanks Ranx, the documentation actually says, that "It is recommended to only
advice a given route once".
I use advice on 2 separate route, those just built by 1 route builder, so
based on the documentation, shouldn't have any kind of error.



--
View this message in context: http://camel.465427.n5.nabble.com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-tp5787900p5788045.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by Brad Johnson <br...@mediadriver.com>.
I don't using weaving in my tests so can't be of a whole lot of help.
Personally I'd try separating the single weave and double into two separate
test files and see if there's any difference. It isn't too surprising that
it fails with multiples especially with exception handling given the
cautionary note in the camel docs.  That's why I wonder if a simple test
with only one advice and no exception handling in its own test file works
as expected.  If not then that smells like a test framework bug.  But, hey,
what do I know?  Like I said I've always used different mechanisms for
testing and don't really use weaving.  Just thought I'd throw some thoughts
out there since nobody else on the forum seems to have any ideas either.
Wish I could be of more help.

http://camel.apache.org/advicewith.html

On Fri, Sep 23, 2016 at 3:36 AM, ncsibra <No...@epam.com> wrote:

> Can somebody confirm that am I doing something wrong or is this really a
> bug?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-
> tp5787900p5787949.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by ncsibra <No...@epam.com>.
Can somebody confirm that am I doing something wrong or is this really a bug?



--
View this message in context: http://camel.465427.n5.nabble.com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-tp5787900p5787949.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: weaveAddFirst doesn't work correctly with route level onException

Posted by ncsibra <No...@epam.com>.
Upload a corrected file, which starts the route after adviceWith setup, but
doesn't matter, it fails with the same exception.

OnExceptionTest.java
<http://camel.465427.n5.nabble.com/file/n5787901/OnExceptionTest.java>  



--
View this message in context: http://camel.465427.n5.nabble.com/weaveAddFirst-doesn-t-work-correctly-with-route-level-onException-tp5787900p5787901.html
Sent from the Camel - Users mailing list archive at Nabble.com.