You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by boday <bo...@vektrel.com> on 2009/08/20 20:04:58 UTC

SMX/Camel - no handler found for message

I have a simple Camel route with a simple onException() clause...

      onException(NoHandlerException.class).
                     
maximumRedeliveries(0).to("activemq:NFNoHandlerException");

   	from("activemq:GatewayMsgQueue")
    	.convertBodyTo(DOMSource.class)
	.to("jbi:service:http://www.test.com/eda/messageProcessor?mep=in-out")
    	.convertBodyTo(String.class)
	.process(new MessageProcessorResultHandler())
	.to("activemq:topic:PortalTopic");

the JBI service "messageProcessor" throws a NoHandlerException, but it isn't
being caught by the exception handling, instead I get this message...

On delivery attempt: 0 caught:
com.test.eda.messageprocessor.messagehandler.exceptions.NoHandlerException:
no handler found for
message

Why can't Camel find my exception that was registered in the onException()
method?  

I'm using SMX 3.3.1/Camel 1.6.1...

thanks...


-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25067044.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SMX/Camel - no handler found for message

Posted by boday <bo...@vektrel.com>.
Clause, I'm using SMX 3.3.1 and Camel 1.6.1.  Not sure I follow your logic on
the usage of "handled(true)"...I thought that just prevented the exception
from being propagated back to the client (or to a higher level exception
handler...DLQ in my case).  Anyways, I'll attempt to debug this further and
let you know...

Along these lines, I'm still a bit confused about when to use a Fault vs. an
Exception...maybe Faults can be used to get around these issues to some
degree...any thoughts?

thanks again



-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25103731.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SMX/Camel - no handler found for message

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Aug 21, 2009 at 7:55 PM, boday<bo...@vektrel.com> wrote:
>
> good call Claus, that seems to be the issue.  I was able to handle it with
> the  onException(Exception.class) defined.  Also, I tried throwing an
> explicit IOException and catching it with onException(IOException.class) and
> that worked as well.
>
> So the issue appears to be with custom exception types.  Is there anything
> special that I need to do to get these exceptions to work?  The exception
> classes are defined in an external jar file that I reference as a dependency
> in both my servicemix-bean SU and servicemix-camel SU.  The classes
> themselves are very simple and just extend the base java.lang.Exception
> class...
>

Which version of Camel are you using? I believe older versions do not
detect to well wrapped exceptions.
But its a bit strange your class is not picked up. You can always debug :)

> One other comment, it doesn't seem to forward the exception to my queue,
> using this...
>
> onException(IOException.class).handled(true).maximumRedeliveries(0).to("activemq:NFNoHandlerExceptions");
>
> I know the exception is being caught though because it hits my breakpoint
> when I just forward to a processor method()...
>
> onException(IOException.class).handled(true).maximumRedeliveries(0).process(new
> MyFunctionFailureHandler())
>
> Any thoughts?
>

Yeah when you use handled(true) you take care of the exception so the
exception is gone.
Its like try .. catch where you do handle it as well.

The caused exception could be stored as a property on the Exchange so
take a look at that one in your my function failure handler.


> thanks again...
>
>
> Claus Ibsen-2 wrote:
>>
>> Try with onException(Exception.class) to catch all exceptions to see if it
>> then
>> handles it.
>>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25084564.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: SMX/Camel - no handler found for message

Posted by Claus Ibsen <cl...@gmail.com>.
Try with

onException(Exception.class) to catch all exceptions to see if it then
handles it.

On Thu, Aug 20, 2009 at 9:24 PM, boday<bo...@vektrel.com> wrote:
>
> sorry for the confusion, that was my error message (see my edited previous
> post).  My exception does appear to be caught...but Camel isn't routing it
> my queue and the deadLetterQueue policy is being fired instead.
>
> thanks again...
>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25068302.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: SMX/Camel - no handler found for message

Posted by boday <bo...@vektrel.com>.
sorry for the confusion, that was my error message (see my edited previous
post).  My exception does appear to be caught...but Camel isn't routing it
my queue and the deadLetterQueue policy is being fired instead.

thanks again...



-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25068302.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SMX/Camel - no handler found for message

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 20, 2009 at 9:09 PM, boday<bo...@vektrel.com> wrote:
>
> Claus, no luck.  I set the clause to...
>
>        onException(NoHandlerException.class).handled(true)
>
> .maximumRedeliveries(0).to("activemq:NFNoHandlerException");
>
> but I still get the same error..."no handler found for message".

Is that you error message or something from servicemix?

You can enable  the tracer to see the message and which
headers/properties it has.
http://camel.apache.org/tracer

There could be a glitch somewhere?


>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> Do you want the message to be moved to that AMQ destination if there
>> is an exception?
>> If so you need to add .handled(true) to the .onException to signal
>> that you are handling the exception.
>>
>>
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25068046.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: SMX/Camel - no handler found for message

Posted by boday <bo...@vektrel.com>.
Claus, no luck.  I set the clause to...

 	onException(NoHandlerException.class).handled(true)
                
.maximumRedeliveries(0).to("activemq:NFNoHandlerException");

but I still get the same error..."no handler found for message".  


Claus Ibsen-2 wrote:
> 
> Hi
> 
> Do you want the message to be moved to that AMQ destination if there
> is an exception?
> If so you need to add .handled(true) to the .onException to signal
> that you are handling the exception.
> 
> 


-----
Ben - Senior Consultant

-- 
View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25068046.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SMX/Camel - no handler found for message

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Do you want the message to be moved to that AMQ destination if there
is an exception?
If so you need to add .handled(true) to the .onException to signal
that you are handling the exception.

On Thu, Aug 20, 2009 at 8:04 PM, boday<bo...@vektrel.com> wrote:
>
> I have a simple Camel route with a simple onException() clause...
>
>      onException(NoHandlerException.class).
>
> maximumRedeliveries(0).to("activemq:NFNoHandlerException");
>
>        from("activemq:GatewayMsgQueue")
>        .convertBodyTo(DOMSource.class)
>        .to("jbi:service:http://www.test.com/eda/messageProcessor?mep=in-out")
>        .convertBodyTo(String.class)
>        .process(new MessageProcessorResultHandler())
>        .to("activemq:topic:PortalTopic");
>
> the JBI service "messageProcessor" throws a NoHandlerException, but it isn't
> being caught by the exception handling, instead I get this message...
>
> On delivery attempt: 0 caught:
> com.test.eda.messageprocessor.messagehandler.exceptions.NoHandlerException:
> no handler found for
> message
>
> Why can't Camel find my exception that was registered in the onException()
> method?
>
> I'm using SMX 3.3.1/Camel 1.6.1...
>
> thanks...
>
>
> -----
> Ben - Senior Consultant
>
> --
> View this message in context: http://www.nabble.com/SMX-Camel---no-handler-found-for-message-tp25067044p25067044.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus