[mule-user] XSLT transformation problem

0 views
Skip to first unread message

Chathura Ekanayake

unread,
Jun 15, 2007, 6:10:39 AM6/15/07
to us...@mule.codehaus.org
Hi,

I am trying to use Mule for transforming request messages before sending to a backend server and then
to transform back the responses before sending to the client.

Below is the model part of my configuration:

<model name="MyMuleModel">
        <mule-descriptor name="MyMule" implementation="org.mule.components.simple.BridgeComponent">
            <inbound-router>
                <endpoint address="http://localhost:8090/services" transformers="Xsltin" responseTransformers="Xsltout" synchronous="true"/>
            </inbound-router>
            <outbound-router>
                <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
                    <endpoint address=" http://localhost:9000/soap/SimpleStockQuoteService"/>
                </router>
            </outbound-router>
        </mule-descriptor>
   </model>

When I am testing this, an exception occurs for every other message. (i.e. first message gets the correct response and the second message fails)
It is appreciated if someone can explain what is going wrong here and direct me to avoid this.

The error printed in the Mule console for failed messages is shown below:

ERROR 2007-06-15 16:03:38,488 [connector.http.0.endpoint.http.localhost.8090.services.receiver.3] org.mule.impl.DefaultExceptionStrategy :
********************************************************************************
Message               : Failed to route event via endpoint: MuleEndpoint{connector=org.mule.providers.http.HttpConnector@970c0e, endpointUri= http://localhost:9000/soap/SimpleStockQuoteService, transformer=Transformer{name='ObjectToHttpClientMethodRequest', returnClass=false, returnClass=false, sourceTypes=[class java.lang.Object]}, name='endpoint.http.localhost.9000.soap.SimpleStockQuoteService', type='sender', properties={}, transactionConfig=Transaction{factory=null, action=NONE, timeout=30000}, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=null, initialState=started, createConnector=0, remoteSync=false, remoteSyncTimeout=10000, endpointEncoding=null}. Message payload is of type: [B
Type                  : org.mule.umo.provider.DispatchException
Code                  : MULE_ERROR-42999
JavaDoc               : http://mule.codehaus.org/docs/apidocs/org/mule/umo/provider/DispatchException.html
Payload               : [B@10a5c21
********************************************************************************
Exception stack is:
1. Connection reset (java.net.SocketException)
  java.net.SocketInputStream:168 (http://java.sun.com/j2se/1.5.0/docs/api/java/net/SocketException.html )
2. Failed to route event via endpoint: MuleEndpoint{connector=org.mule.providers.http.HttpConnector@970c0e, endpointUri=http://localhost:9000/soap/SimpleStockQuoteService , transformer=Transformer{name='ObjectToHttpClientMethodRequest', returnClass=false, returnClass=false, sourceTypes=[class java.lang.Object]}, name='endpoint.http.localhost.9000.soap.SimpleStockQuoteService ', type='sender', properties={}, transactionConfig=Transaction{factory=null, action=NONE, timeout=30000}, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=null, initialState=started, createConnector=0, remoteSync=false, remoteSyncTimeout=10000, endpointEncoding=null}. Message payload is of type: [B ( org.mule.umo.provider.DispatchException)
  org.mule.providers.http.HttpClientMessageDispatcher:220 (http://mule.codehaus.org/docs/apidocs/org/mule/umo/provider/DispatchException.html )
********************************************************************************
Root Exception stack trace:
java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java :168)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
        at org.apache.commons.httpclient.HttpParser.readRawLine (HttpParser.java:77)
        at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
        at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine (MultiThreadedHttpConnectionManager.java:1373)
        at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java :1590)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
        at org.apache.commons.httpclient.HttpClient.executeMethod (HttpClient.java:346)
        at org.mule.providers.http.HttpClientMessageDispatcher.execute(HttpClientMessageDispatcher.java:209)
        at org.mule.providers.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java :323)
        at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:233)
        at org.mule.impl.MuleSession.sendEvent(MuleSession.java:328)
        at org.mule.impl.MuleSession.sendEvent (MuleSession.java:209)
        at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:118)
        at org.mule.routing.outbound.FilteringOutboundRouter.route(FilteringOutboundRouter.java :67)
        at org.mule.routing.outbound.OutboundPassThroughRouter.route(OutboundPassThroughRouter.java:81)
        at org.mule.routing.outbound.OutboundMessageRouter$1.doInTransaction(OutboundMessageRouter.java:76)
        at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:39)
        at org.mule.routing.outbound.OutboundMessageRouter.route(OutboundMessageRouter.java:81)
        at org.mule.routing.inbound.ForwardingConsumer.process (ForwardingConsumer.java:51)
        at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:84)
        at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage (AbstractMessageReceiver.java:558)
        at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:304)
        at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java :262)
        at org.mule.providers.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:235)
        at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:987)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
        at java.lang.Thread.run(Thread.java:595)

Thanks,
Chathura C. Ekanayake

Andrew Perepelytsya

unread,
Jun 15, 2007, 10:28:40 PM6/15/07
to us...@mule.codehaus.org
Try using ChainedRouter in synchronous mode with a single endpoint instead.

Andrew

Chathura Ekanayake

unread,
Jul 8, 2007, 5:44:33 AM7/8/07
to us...@mule.codehaus.org
Hi Andrew,

I tried this with org.mule.routing.outbound.ChainingRouter as you have mentioned, but still getting the same error.
Is there any other way to get this working?

Chathura
Reply all
Reply to author
Forward
0 new messages