[mule-user] default-service-exception-strategy : unable to route message in case of exception

1 view
Skip to first unread message

sige

unread,
Sep 21, 2009, 12:56:32 AM9/21/09
to us...@mule.codehaus.org

Hi,

I am trying to use the default-service-exception-strategy to route message
to an error.queue, with the following config:

<service name="quakeService">
<inbound>
<jms:inbound-endpoint connector-ref="jmsConnector"
queue="msg.in">
<jms:transaction action="ALWAYS_BEGIN" />
</jms:inbound-endpoint>
</inbound>

<component class="org.geonet.esb.QuakeComponent"/>

<outbound>
<pass-through-router>
<jms:outbound-endpoint connector-ref="jmsConnector"
queue="msg.out">
<jms:transaction action="ALWAYS_JOIN" />
</jms:outbound-endpoint>
</pass-through-router>
</outbound>
<default-service-exception-strategy >
<commit-transaction
exception-pattern="org.geonet.esb.QuakeException"/>
<jms:outbound-endpoint queue="msg.err"/>
</default-service-exception-strategy>
</service>

when the component throws an exception, I got the following errors and the
message didn't go to the msg.err queue as expected:

1. ERROR 2009-09-21 16:37:08,149 [ActiveMQ Session Task]
org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy:
null
java.lang.NullPointerException
at
org.apache.activemq.command.ActiveMQTempDestination.delete(ActiveMQTempDestination.java:50)
at org.mule.transport.jms.JmsConnector.close(JmsConnector.java:775)
at
org.mule.transport.jms.JmsConnector.closeQuietly(JmsConnector.java:789)
......

2. ERROR 2009-09-21 16:37:08,163 [ActiveMQ Session Task]
org.mule.DefaultExceptionStrategy:
********************************************************************************
Message : The object transformed is of type:
"ExceptionMessage", but the expected return type is "String"
Type : org.mule.api.transformer.TransformerException
Code : MULE_ERROR-65053
JavaDoc :
http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transformer/TransformerException.html
Transformer : JMSMessageToObject{this=adf5be,
name='_JMSMessageToString', ignoreBadInput=false, returnClass=class
java.lang.String, sourceTypes=[interface javax.jms.Message, interface
javax.jms.TextMessage, interface javax.jms.ObjectMessage, interface
javax.jms.BytesMessage, interface javax.jms.MapMessage, interface
javax.jms.StreamMessage]}
********************************************************************************
Exception stack is:
1. The object transformed is of type: "ExceptionMessage", but the expected
return type is "String" (org.mule.api.transformer.TransformerException)
org.mule.transformer.AbstractTransformer:87
(http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transformer/TransformerException.html)
********************************************************************************
Root Exception stack trace:
org.mule.api.transformer.TransformerException: The object transformed is of
type: "ExceptionMessage", but the expected return type is "String"
at
org.mule.transformer.AbstractTransformer.checkReturnClass(AbstractTransformer.java:87)
at
org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:267)
at
org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:198)
at
org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:146)
at
org.mule.DefaultMuleMessage.getPayloadAsString(DefaultMuleMessage.java:320)
at
org.mule.DefaultMuleMessage.getPayloadAsString(DefaultMuleMessage.java:293)
at
org.mule.AbstractExceptionListener.getErrorMessagePayload(AbstractExceptionListener.java:351)
at
org.mule.AbstractExceptionListener.routeException(AbstractExceptionListener.java:294)
at
org.mule.DefaultExceptionStrategy.handleMessagingException(DefaultExceptionStrategy.java:30)
at
org.mule.DefaultExceptionStrategy.handleStandardException(DefaultExceptionStrategy.java:53)
at
org.mule.AbstractExceptionListener.exceptionThrown(AbstractExceptionListener.java:166)
at
org.mule.transport.AbstractConnector.handleException(AbstractConnector.java:752)
at
org.mule.transport.AbstractConnectable.handleException(AbstractConnectable.java:93)
at
org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:184)
at
org.mule.transport.AbstractConnector.send(AbstractConnector.java:2016)
at
org.mule.endpoint.DefaultOutboundEndpoint.send(DefaultOutboundEndpoint.java:76)
at
org.mule.AbstractExceptionListener.routeException(AbstractExceptionListener.java:312)
at
org.mule.service.DefaultServiceExceptionStrategy.routeException(DefaultServiceExceptionStrategy.java:60)
at
org.mule.DefaultExceptionStrategy.handleMessagingException(DefaultExceptionStrategy.java:30)
at
org.mule.AbstractExceptionListener.exceptionThrown(AbstractExceptionListener.java:145)
at
org.mule.service.AbstractService.handleException(AbstractService.java:546)
at org.mule.model.seda.SedaService.doSend(SedaService.java:272)
at
org.mule.service.AbstractService.sendEvent(AbstractService.java:500)
at
org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
at
org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:228)
......


I have no idea why the transformer expect a String, I have tried to set an
objectToString transformer, but that didn't help.

Please help,

Thank,

Sige



--
View this message in context: http://www.nabble.com/default-service-exception-strategy-%3A-unable-to-route-message-in-case-of-exception-tp25530180p25530180.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Andrew Perepelytsya

unread,
Sep 21, 2009, 9:23:13 AM9/21/09
to us...@mule.codehaus.org

I think there was a problem with the exception endpoint transformer which has been fixed post 2.2.1.

HTH,
Andrew

sige

unread,
Sep 21, 2009, 5:43:42 PM9/21/09
to us...@mule.codehaus.org

It seems the jms endpoint at the default-service-strategy has a
JMSMessageToObject transformer which expects a string message, while the
message from the component is in the format of ExceptionMessage, I have
tried to change the jms error queue to a file outout, which works fine.

In order to get the jms error queue working, I have also tried to use a
default-connector-strategy with the jms error queue, and removed the
default-service-strategy (or explicitly specify the rollback-pattern in the
default-service-strategy), but still unable to route the message to the
error queue, the error was simply logged and the message was consumed.

Is there anything wrong with the configuration or the use of the jms
transaction?

Thanks,

Sige


--
View this message in context: http://www.nabble.com/default-service-exception-strategy-%3A-unable-to-route-message-in-case-of-exception-tp25530180p25530497.html

Antoine Borg

unread,
Sep 28, 2009, 2:33:46 AM9/28/09
to us...@mule.codehaus.org
That's unusual .. a JMSMessageToObject transformer should expect a
JMSMessage not a string.

A

sige wrote:
> It seems the jms endpoint at the default-service-strategy has a
> JMSMessageToObject transformer which expects a string message, while the
> message from the component is in the format of ExceptionMessage, I have
> tried to change the jms error queue to a file outout, which works fine.
>
> In order to get the jms error queue working, I have also tried to use a
> default-connector-strategy with the jms error queue, and removed the
> default-service-strategy (or explicitly specify the rollback-pattern in the
> default-service-strategy), but still unable to route the message to the
> error queue, the error was simply logged and the message was consumed.
>
> Is there anything wrong with the configuration or the use of the jms
> transaction?
>
> Thanks,
>
> Sige
>
>
>
--

Antoine Borg, Director of Services | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM

See our full schedule of Mule and Android courses:
http://www.ricston.com/courses/schedules/

email: _antoin...@ricston.com <mailto:antoin...@ricston.com> |
blog: blog.ricston.com <http://blog.ricston.com> | web: ricston.com
<http://www.ricston.com/>

Reply all
Reply to author
Forward
0 new messages