Hi Ajith,

The scenario which you have tested is not correct. If you put <send/>
mediator in the outSequence, since you are cloning the request and send to
2 back ends, ESB will get 2 responses and tries to send back 2 responses to
client and that is causing this exception. What happens is that ESB will
send back the first response and then release the connection. When it tries
to send back the 2nd response, If some other thread has already reused that
connection, the "request" will be null and that is causing the NPE.

If you are putting a <send/> mediator in the outSequence, make sure you
aggregate the responses before sending the response back.

On Mon, Oct 5, 2015 at 9:23 PM, Ajith Vitharana <aji...@wso2.com> wrote:

>
>
> On Mon, Oct 5, 2015 at 5:59 AM, Chanaka Fernando <chana...@wso2.com>
> wrote:
>
>> Hi Ajith,
>>
>> We have already identified this issue and currently working on a fix.
>> Thanks for reporting this issue.
>>
>
> Thanks for looking to this.
>
> -Ajith
>
>>
>> On Mon, Oct 5, 2015 at 12:56 AM, Ajith Vitharana <aji...@wso2.com> wrote:
>>
>>> Hi All
>>>
>>> I did a slight change to sample [1] (used <send/> instead of <drop/> at
>>> the outSequence) , now I'm getting following exception.
>>>
>>> [1] https://docs.wso2.com/display/IntegrationPatterns/Durable+Subscriber
>>>
>>>
>>>
>>> [2015-10-04 15:19:30,891] DEBUG - wire << "[\r][\n]"
>>> [2015-10-04 15:19:30,892] ERROR - PassThroughHttpSender Failed to submit
>>> the response
>>> j*ava.lang.NullPointerException*
>>> * at
>>> org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:64)*
>>> * at
>>> org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:462)*
>>> * at
>>> org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267)*
>>> * at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)*
>>> at
>>> org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212)
>>> at
>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:444)
>>> at
>>> org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:102)
>>> at
>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
>>> at
>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
>>> at
>>> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
>>> at
>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:297)
>>> at
>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529)
>>> at
>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
>>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>>> at
>>> org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247)
>>> at
>>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>> at java.lang.Thread.run(Thread.java:745)
>>> [2015-10-04 15:19:30,894] ERROR - Axis2Sender
>>> Content-Type:application/soap+xml; charset=UTF-8;
>>> action="urn:getQuoteResponse",<?xml version='1.0'
>>> encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
>>> http://www.w3.org/2003/05/soap-envelope";><soapenv:Body/></soapenv:Envelope>
>>> Unexpected error sending message back
>>> org.apache.axis2.AxisFault: Failed to submit the response
>>> at
>>> org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:610)
>>> at
>>> org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:269)
>>> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
>>> at
>>> org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212)
>>> at
>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:444)
>>> at
>>> org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:102)
>>> at
>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
>>> at
>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
>>> at
>>> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
>>> at
>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:297)
>>> at
>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529)
>>> at
>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
>>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>>> at
>>> org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247)
>>> at
>>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>> at java.lang.Thread.run(Thread.java:745)
>>> *Caused by: java.lang.NullPointerException*
>>> * at
>>> org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:64)*
>>> * at
>>> org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:462)*
>>> * at
>>> org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267)*
>>> * ... 16 more*
>>> [2015-10-04 15:19:30,898]  INFO - LogMediator To:
>>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>>> , MessageID: urn:uuid:4acfe16a-ee7d-4ab6-b35b-f0e3946160c9, Direction:
>>> response, MESSAGE = Executing default "fault" sequence, ERROR_CODE = 0,
>>> ERROR_MESSAGE = Content-Type:application/soap+xml; charset=UTF-8;
>>> action="urn:getQuoteResponse",<?xml version='1.0'
>>> encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
>>> http://www.w3.org/2003/05/soap-envelope";><soapenv:Body/></soapenv:Envelope>
>>> Unexpected error sending message back, Envelope: <?xml version='1.0'
>>> encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
>>> http://www.w3.org/2003/05/soap-envelope";><soapenv:Body><ns:getQuoteResponse
>>> xmlns:ns="http://services.samples";><ns:return xmlns:ax21="
>>> http://services.samples/xsd"; xmlns:xsi="
>>> http://www.w3.org/2001/XMLSchema-instance";
>>> xsi:type="ax21:GetQuoteResponse"><ax21:change>-2.3202266677546106</ax21:change><ax21:earnings>12.650295806384626</ax21:earnings><ax21:high>-152.04270426044403</ax21:high><ax21:last>154.1916889021466</ax21:last><ax21:lastTradeTimestamp>Sun
>>> Oct 04 15:19:30 EDT
>>> 2015</ax21:lastTradeTimestamp><ax21:low>158.83675994993015</ax21:low><ax21:marketCap>4.917881726394041E7</ax21:marketCap><ax21:name>foo
>>> Company</ax21:name><ax21:open>158.0551704762858</ax21:open><ax21:peRatio>-17.10342133824433</ax21:peRatio><ax21:percentageChange>1.6236826882815951</ax21:percentageChange><ax21:prevClose>-142.89902112648588</ax21:prevClose><ax21:symbol>foo</ax21:symbol><ax21:volume>15263</ax21:volume></ns:return></ns:getQuoteResponse></soapenv:Body></soapenv:Envelope>
>>> [2015-10-04 15:21:30,364]  WARN - SourceHandler Connection time out
>>> after request is read: http-incoming-10
>>>
>>> -Ajith
>>>
>>> --
>>> Ajith Vitharana.
>>>
>>> WSO2 Inc. - http://wso2.com
>>> Email  : aji...@wso2.com
>>> Blog    : http://vitharana.org
>>> Mobile : +1-812-360-5335
>>>
>>>
>>
>>
>> --
>> --
>> Chanaka Fernando
>> Senior Technical Lead
>> WSO2, Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 773337238
>> Blog : http://soatutorials.blogspot.com
>> LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
>> Twitter:https://twitter.com/chanakaudaya
>>
>>
>>
>>
>>
>
>
> --
> Ajith Vitharana.
>
> WSO2 Inc. - http://wso2.com
> Email  : aji...@wso2.com
> Blog    : http://vitharana.org
> Mobile : +1-812-360-5335
>
>


-- 
--
Chanaka Fernando
Senior Technical Lead
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 773337238
Blog : http://soatutorials.blogspot.com
LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
Twitter:https://twitter.com/chanakaudaya
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to