[ESBJAVA-5103] Aggregate mediator does not works when having correlateOn expression Created: 26/May/17  Updated: 26/May/17

Status: Open
Project: WSO2 ESB
Component/s: None
Affects Version/s: 4.9.0
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Nuwan Wimalasekara Assignee: Chanaka Fernando
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Severity: Major
Estimated Complexity: Moderate
Test cases added: Yes

 Description   

Below API not responding with aggregate result since onComplete does not satisfied.

curl http://localhost:8280/test

<api xmlns="http://ws.apache.org/ns/synapse" name="AggregatorTest" context="/test">
   <resource methods="GET">
      <inSequence>
         <property name="enclosing_element" scope="default">
            <result xmlns=""/>
         </property>
         <clone>
            <target>
               <endpoint>
                  <http uri-template="http://www.mocky.io/v2/5925b92d1200004d00686fac"/>
               </endpoint>
            </target>
            <target>
               <endpoint>
                  <http uri-template="http://www.mocky.io/v2/5925b94b1200004a00686fad"/>
               </endpoint>
            </target>
            <target>
               <endpoint>
                  <http uri-template="http://www.mocky.io/v2/5925b96c1200001200686faf"/>
               </endpoint>
            </target>
         </clone>
      </inSequence>
      <outSequence>
         <aggregate>
            <correlateOn expression="//data/type[text()='1']"/>
            <completeCondition>
               <messageCount min="2" max="-1"/>
            </completeCondition>
            <onComplete expression="//data/type" enclosingElementProperty="enclosing_element">
               <respond/>
            </onComplete>
         </aggregate>
      </outSequence>
   </resource>
</api>





[ESBJAVA-5102] Auth headers are swapping when call to the endpoint Created: 25/May/17  Updated: 25/May/17

Status: Open
Project: WSO2 ESB
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Patch Priority: Highest
Reporter: Kavitha Subramaniyam Assignee: Chanaka Fernando
Resolution: Unresolved Votes: 0
Labels: synapse
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Reproduced in APIM 2.1.0


Estimated Complexity: Moderate
Test cases added: Not-applicable

 Description   

The issue comes using APIM 2.1.0 when call to an endpoint which configured to support both BASIC and NTLM authentication, observed [1] the order of AUTH headers swapped. This cause for an issue that always try with BASIC type instead of NTLM type.

The cause for this issue suspected in synapse component which reorder the headers. According to HTTP spec [2] this needs to be fixed.

The order in which header fields with the same
field-name are received is therefore significant to the
interpretation of the combined field value, and thus a proxy MUST NOT
change the order of these field values when a message is forwarded.

[1]

When APIM call the back end wirelogs is as follows
[2017-05-22 12:11:13,562] DEBUG - headers http-outgoing-2 >> GET /posts?id=1 HTTP/1.1
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> WWW-Authenticate: ANTLM3
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> WWW-Authenticate: Basic realm="BasicSecurityFilterProvider"
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> WWW-Authenticate: NTLM
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> Authorization: Basic YWRtaW46YWRtaW4=
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> Accept: application/json
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> Host: jsonplaceholder.typicode.com
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> Connection: Keep-Alive
[2017-05-22 12:11:13,563] DEBUG - headers http-outgoing-2 >> User-Agent: Synapse-PT-HttpComponents-NIO

[2] https://tools.ietf.org/html/rfc2616#section-4.2

Thanks,






[ESBJAVA-5101] Dynamic Xpath support for 'enclosing element' and 'timeout' values in aggregate mediator Created: 24/May/17  Updated: 24/May/17

Status: Open
Project: WSO2 ESB
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Normal
Reporter: Sohani Weerasinghe Assignee: Chanaka Fernando
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Severity: Major
Estimated Complexity: Moderate
Test cases added: Yes

 Description   

When using an aggregate mediator inside a sequence template, currently it is not supported to have dynamic Xpath values for 'enclosing element' and 'timeout' values.






[ESBJAVA-5100] Error when proxy service try to failover with loadbalance endpoint. Created: 22/May/17  Updated: 23/May/17

Status: In Progress
Project: WSO2 ESB
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Nuwan Wimalasekara Assignee: Nuwan Wimalasekara
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Severity: Major
Estimated Complexity: Moderate
Test cases added: Yes

 Description   

bellow error can be observed when failover happens in loadbalance endpoint for soap messages since message stream is consumed, It failed to send the message again.

TID: [-1] [] [2017-05-10 08:59:26,260] ERROR

{org.apache.synapse.core.axis2.Axis2Sender} - Unexpected error during sending message out {org.apache.synapse.core.axis2.Axis2Sender}

org.apache.axis2.AxisFault: Trying to write END_DOCUMENT when document has no root (ie. trying to output empty document).
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.sendRequestContent(PassThroughHttpSender.java:388)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:259)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:185)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:167)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:560)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:79)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:511)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:372)
at org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:85)
at org.apache.synapse.endpoints.LoadbalanceEndpoint.send(LoadbalanceEndpoint.java:159)
at org.apache.synapse.endpoints.LoadbalanceEndpoint.onChildEndpointFail(LoadbalanceEndpoint.java:279)
at org.apache.synapse.endpoints.AbstractEndpoint.invokeNextFaultHandler(AbstractEndpoint.java:678)
at org.apache.synapse.endpoints.AbstractEndpoint.onFault(AbstractEndpoint.java:515)
at org.apache.synapse.endpoints.HTTPEndpoint.onFault(HTTPEndpoint.java:66)
at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:54)
at org.apache.synapse.core.axis2.TimeoutHandler.processCallbacks(TimeoutHandler.java:188)
at org.apache.synapse.core.axis2.TimeoutHandler.run(TimeoutHandler.java:88)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: javax.xml.stream.XMLStreamException: Trying to write END_DOCUMENT when document has no root (ie. trying to output empty document).
at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1522)
at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1551)
at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1377)
at com.ctc.wstx.sw.BaseStreamWriter.close(BaseStreamWriter.java:247)
at org.apache.axiom.om.impl.MTOMXMLStreamWriter.close(MTOMXMLStreamWriter.java:188)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:197)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
... 21 more



 Comments   
Comment by Nuwan Wimalasekara [ 23/May/17 ]

setting build.message.on.failover.enable to true in synapse.properties file will always build the message before sending

synapse.properties

build.message.on.failover.enable=true

Fixed with PR https://github.com/wso2/wso2-synapse/pull/745





[ESBJAVA-5099] NullPointerException when the tenant being cleaned up before the scheduled task is executed Created: 22/May/17  Updated: 22/May/17

Status: Open
Project: WSO2 ESB
Component/s: None
Affects Version/s: 5.0.0
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Asanka Abeyweera Assignee: Chanaka Fernando
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Severity: Major
Estimated Complexity: Moderate
Attachment License: I agree to grant a license to WSO2 for this work for inclusion in WSO2 works as per the WSO2 Contributor License Agreement and the Apache License 2.0
Test cases added: No

 Description   

Steps to reproduce

  1. Set the tenant lazy loading idle time to a low value like 3 and restart the server.
    <Tenant>
         <LoadingPolicy>
             <LazyLoading>
                 <IdleTime>3</IdleTime>
             </LazyLoading>
             <!-- <EagerLoading>
                    <Include>*,!foo.com,!bar.com</Include>
             </EagerLoading>-->
         </LoadingPolicy>
    </Tenant>
    
  2. Create a new tenant
  3. Using the new tenant add a scheduled task to run every five minutes. Please note that the time used in the scheduled task should be greater than the configured tenant idle time. Sample configuration is mentioned below.
    <?xml version="1.0" encoding="UTF-8"?>
    <task class="org.apache.synapse.startup.tasks.MessageInjector" group="synapse.simple.quartz" name="MyTask" xmlns="http://ws.apache.org/ns/synapse">
      <trigger cron="0 0/5 * 1/1 * ? *"/>
      <property name="injectTo" value="sequence" xmlns:task="http://www.wso2.org/products/wso2commons/tasks"/>
      <property name="message" xmlns:task="http://www.wso2.org/products/wso2commons/tasks">
        <request xmlns=""/>
      </property>
      <property name="sequenceName" value="MySequence" xmlns:task="http://www.wso2.org/products/wso2commons/tasks"/>
    </task>
    

Observed behaviour

Following exception was observed when the scheduled task was run after the tenant was unloaded and reloaded.

[2017-05-17 13:18:59,449] ERROR - SequenceMediator Error while building message
java.lang.NullPointerException
	at org.apache.axis2.context.AbstractContext.needPropertyDifferences(AbstractContext.java:239)
	at org.apache.axis2.context.AbstractContext.setProperty(AbstractContext.java:202)
	at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:107)
	at org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:140)
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83)
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
	at org.apache.synapse.mediators.MediatorWorker.run(MediatorWorker.java:80)
	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)

Workaround

Set the tenant idle time to a value greater than the scheduled time interval






Generated at Fri May 26 21:38:39 IST 2017 using JIRA 7.2.2#72004-sha1:9d5132893cc8c728a3601a9034a1f8547ef5c7be.