Hi,

Our requirement is to aggregate similar soap bodies using aggregate
mediator. With the following synapse.xml with *two log mediators in proxy
services it works fine* *and gives the required aggregated (attached:
aggregated.xml) output*. but if I remove the log mediators in proxy
services it gives the following error (attached: error.txt) and it shows
that for the every message from each proxy "</ns:HOSTS>"  parent tag is
appended as a child element to the last "<ns:HOST>" element. (attached:
errornous_message.xml)
I have also tried with new ESB pack and done it from the scratch but same
thing happened. I also debugged the class mediators and it gives the
required message.

environment: WSO2 ESB 4.8.1

what causes this behavior? anything i'm doing wrong here?

Thanks
--Rajith
-- 
*Rajith Siriwardana*
Software Engineer
WSO2 Inc. ; http://wso2.com
*lean. enterprise. middleware*

------------------------------------------------------
*http://people.apache.org/~siriwardana
<http://people.apache.org/~siriwardana>*
[2014-06-03 09:41:55,992] ERROR - NativeWorkerPool Uncaught exception
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: 
ParseError at [row,col]:[3,66]
Message: XML document structures must start and end within the same entity.
        at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
        at 
org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
        at 
org.apache.synapse.mediators.eip.aggregator.AggregateMediator.mediate(AggregateMediator.java:298)
        at 
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)
        at 
org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:84)
        at 
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:245)
        at 
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:556)
        at 
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:198)
        at 
org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:488)
        at 
org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:170)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at 
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:225)
        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: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,66]
Message: XML document structures must start and end within the same entity.
        at 
com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:598)
        at 
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
        at 
org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
        at 
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
        at 
org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSXPStreamReaderWrapper.java:138)
        at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
        at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
        ... 16 more
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse";>
   <registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
      <parameter name="cachableDuration">15000</parameter>
   </registry>
   <proxy name="GangliaProxy"
          transports="https http"
          startOnLoad="true"
          trace="disable">
      <description/>
      <target>
         <inSequence>
            <class name="org.wso2.carbon.cloud.monitor.agent.mediators.ganglia.GangliaAdapter">
               <property name="port" value="8651"/>
               <property name="gmetadHost" value="localhost"/>
               <property name="metrics" value="CPU_SPEED, disk free,Load_one"/>
            </class>
            <header name="To" action="remove"/>
            <property name="RESPONSE" value="true"/>
            <log level="full">
               <property name="MESSAGE" value="#####-----GANGLIA-----#####"/>
            </log>
            <send/>
         </inSequence>
      </target>
   </proxy>
   <proxy name="CloudHBMonProxy"
          transports="https http"
          startOnLoad="true"
          trace="disable">
      <description/>
      <target>
         <inSequence>
            <class name="org.wso2.carbon.cloud.monitor.agent.mediators.cloudhbmon.CloudHBMonAdapter">
               <property name="port" value="18765"/>
               <property name="cloudHbHost" value="localhost"/>
            </class>
            <header name="To" action="remove"/>
            <property name="RESPONSE" value="true"/>
            <log level="full">
               <property name="MESSAGE" value="#####---CLOUD MON----#####"/>
            </log>
            <send/>
         </inSequence>
      </target>
   </proxy>
   <sequence name="proxysq">
      <property xmlns:ns="http://org.apache.synapse/xsd";
                xmlns:nsp="http://agent.monitor.cloud.carbon.wso2.org";
                name="CPU_SPEED"
                expression="//nsp:METRIC/@VALUE[ ../@NAME = 'cpu_speed' ]"
                scope="default"
                type="STRING"/>
      <property xmlns:ns="http://org.apache.synapse/xsd";
                xmlns:nsp="http://agent.monitor.cloud.carbon.wso2.org";
                name="LOAD_ONE"
                expression="//nsp:METRIC/@VALUE[ ../@NAME = 'load_one' ]"
                scope="default"
                type="STRING"/>
      <property xmlns:ns="http://org.apache.synapse/xsd";
                xmlns:nsp="http://agent.monitor.cloud.carbon.wso2.org";
                name="DISK_FREE"
                expression="//nsp:METRIC/@VALUE[ ../@NAME = 'disk_free' ]"
                scope="default"
                type="STRING"/>
      <property xmlns:ns="http://org.apache.synapse/xsd";
                xmlns:nsp="http://agent.monitor.cloud.carbon.wso2.org";
                name="HOST_NAME"
                expression="//nsp:HOST/@NAME"
                scope="default"
                type="STRING"/>
      <bam>
         <serverProfile name="CloudMonitor">
            <streamConfig name="cloudmon" version="1.0.0"/>
         </serverProfile>
      </bam>
   </sequence>
   <sequence name="fault">
      <log level="full">
         <property name="MESSAGE" value="Executing default 'fault' sequence"/>
         <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
         <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
      </log>
      <drop/>
   </sequence>
   <sequence name="main">
      <in>
         <clone id="cln">
            <target>
               <sequence>
                  <call>
                     <endpoint>
                        <address uri="http://localhost:8282/services/GangliaProxy"/>
                     </endpoint>
                  </call>
               </sequence>
            </target>
            <target>
               <sequence>
                  <call>
                     <endpoint>
                        <address uri="http://localhost:8282/services/CloudHBMonProxy"/>
                     </endpoint>
                  </call>
               </sequence>
            </target>
         </clone>
         <property name="ECNCLOSING_ELEMENT" scope="default">
            <wrapper xmlns=""/>
         </property>
         <aggregate id="cln">
            <completeCondition>
               <messageCount min="-1" max="-1"/>
            </completeCondition>
            <onComplete xmlns:nsp="http://agent.monitor.cloud.carbon.wso2.org";
                        xmlns:ns="http://org.apache.synapse/xsd";
                        expression="//nsp:WSO2_CLOUD_MON"
                        enclosingElementProperty="ECNCLOSING_ELEMENT">
               <log level="full">
                  <property name="MESSAGE" value="#####-----AGGREGATED-----#####"/>
               </log>
            </onComplete>
         </aggregate>
      </in>
      <out>
         <send/>
      </out>
      <description>The main sequence for the message mediation</description>
   </sequence>
   <task name="cloudmon_task"
         class="org.apache.synapse.startup.tasks.MessageInjector"
         group="synapse.simple.quartz">
      <trigger interval="60"/>
      <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks"; name="message">
         <ns:WSO2_CLOUD_MON xmlns:ns="http://agent.monitor.cloud.carbon.wso2.org"; VERSION="1.0.0">
            <ns:HOSTS/>
         </ns:WSO2_CLOUD_MON>
      </property>
      <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks";
                name="sequenceName"
                value="main"/>
   </task>
</definitions>
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
	<soapenv:Body>
		<wrapper>
			<ns:WSO2_CLOUD_MON VERSION="1.0.0" xmlns:ns="http://agent.monitor.cloud.carbon.wso2.org";>
				<ns:HOSTS>
					<ns:HOST NAME="gnu">
						<ns:METRIC NAME="cpu_speed" VALUE="2701"/>
						<ns:METRIC NAME="reported" VALUE="1401716263"/>
						<ns:METRIC NAME="load_one" VALUE="0.63"/>
						<ns:METRIC NAME="disk_free" VALUE="137.694"/>
						<ns:METRIC NAME="cluster" VALUE="WSO2-Cloud-mon-cluster"/>
						<ns:METRIC NAME="grid" VALUE="unspecified"/>
						<ns:METRIC NAME="ip" VALUE="10.100.5.79"/>
					</ns:HOST>
					<ns:HOST NAME="192.168.1.7">
						<ns:METRIC NAME="reported" VALUE="1401656000"/>
						<ns:METRIC NAME="cluster" VALUE="WSO2-Cloud-mon-cluster"/>
						<ns:METRIC NAME="grid" VALUE="unspecified"/>
						<ns:METRIC NAME="ip" VALUE="192.168.1.7"/>
					</ns:HOST>
					<ns:HOST NAME="10.100.5.88">
						<ns:METRIC NAME="cpu_speed" VALUE="1500"/>
						<ns:METRIC NAME="reported" VALUE="1401709244"/>
						<ns:METRIC NAME="load_one" VALUE="0.24"/>
						<ns:METRIC NAME="disk_free" VALUE="128.598"/>
						<ns:METRIC NAME="cluster" VALUE="WSO2-Cloud-mon-cluster"/>
						<ns:METRIC NAME="grid" VALUE="unspecified"/>
						<ns:METRIC NAME="ip" VALUE="10.100.5.88"/>
					</ns:HOST>
				</ns:HOSTS>
			</ns:WSO2_CLOUD_MON>
			<ns:WSO2_CLOUD_MON VERSION="1.0.0" xmlns:ns="http://agent.monitor.cloud.carbon.wso2.org";>
				<ns:HOSTS>
					<ns:HOST>
						<ns:METRIC NAME="reported" VALUE="1401722971000"/>
						<ns:METRIC NAME="hive_script_execution_test" VALUE="0"/>
						<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
						<ns:METRIC NAME="server" VALUE="Business Activity Monitor"/>
					</ns:HOST>
					<ns:HOST>
						<ns:METRIC NAME="reported" VALUE="1401713691000"/>
						<ns:METRIC NAME="change_passsword_test" VALUE="0"/>
						<ns:METRIC NAME="import_user_members_to_tenant_test" VALUE="0"/>
						<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
						<ns:METRIC NAME="server" VALUE="Cloud Management"/>
					</ns:HOST>
					<ns:HOST>
						<ns:METRIC NAME="reported" VALUE="1401722102000"/>
						<ns:METRIC NAME="application_build_test" VALUE="1"/>
						<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
						<ns:METRIC NAME="server" VALUE="Appfactory"/>
						<ns:METRIC NAME="import_member_to_tenant_test" VALUE="1"/>
					</ns:HOST>
				</ns:HOSTS>
			</ns:WSO2_CLOUD_MON>
		</wrapper>
	</soapenv:Body>
</soapenv:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
	<soapenv:Body>
		<ns:WSO2_CLOUD_MON VERSION="1.0.0" xmlns:ns="http://agent.monitor.cloud.carbon.wso2.org";>
			<ns:HOSTS>
				<ns:HOST NAME="10.100.4.57:9443">
					<ns:METRIC NAME="reported" VALUE="1401769526000"/>
					<ns:METRIC NAME="hive_script_execution_test" VALUE="0"/>
					<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
					<ns:METRIC NAME="server" VALUE="Business Activity Monitor"/>
				</ns:HOST>
				<ns:HOST NAME="cloudmgt.cloudpreview.wso2.com">
					<ns:METRIC NAME="reported" VALUE="1401768444000"/>
					<ns:METRIC NAME="change_passsword_test" VALUE="0"/>
					<ns:METRIC NAME="import_user_members_to_tenant_test" VALUE="0"/>
					<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
					<ns:METRIC NAME="server" VALUE="Cloud Management"/>
				</ns:HOST>
				<ns:HOST NAME="appfactory.cloudpreview.wso2.com">
					<ns:METRIC NAME="reported" VALUE="1401767747000"/>
					<ns:METRIC NAME="application_build_test" VALUE="0"/>
					<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
					<ns:METRIC NAME="server" VALUE="Appfactory"/>
					<ns:METRIC NAME="import_member_to_tenant_test" VALUE="1"/>
					<ns:HOSTS/>
				</ns:HOST>
			</ns:HOSTS>
		</ns:WSO2_CLOUD_MON>
	</soapenv:Body>
</soapenv:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
	<soapenv:Body>
		<ns:WSO2_CLOUD_MON VERSION="1.0.0" xmlns:ns="http://agent.monitor.cloud.carbon.wso2.org";>
			<ns:HOSTS>
				<ns:HOST NAME="10.100.4.57:9443">
					<ns:METRIC NAME="reported" VALUE="1401769526000"/>
					<ns:METRIC NAME="hive_script_execution_test" VALUE="0"/>
					<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
					<ns:METRIC NAME="server" VALUE="Business Activity Monitor"/>
				</ns:HOST>
				<ns:HOST NAME="cloudmgt.cloudpreview.wso2.com">
					<ns:METRIC NAME="reported" VALUE="1401768444000"/>
					<ns:METRIC NAME="change_passsword_test" VALUE="0"/>
					<ns:METRIC NAME="import_user_members_to_tenant_test" VALUE="0"/>
					<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
					<ns:METRIC NAME="server" VALUE="Cloud Management"/>
				</ns:HOST>
				<ns:HOST NAME="appfactory.cloudpreview.wso2.com">
					<ns:METRIC NAME="reported" VALUE="1401767747000"/>
					<ns:METRIC NAME="application_build_test" VALUE="0"/>
					<ns:METRIC NAME="tenant_login_test" VALUE="0"/>
					<ns:METRIC NAME="server" VALUE="Appfactory"/>
					<ns:METRIC NAME="import_member_to_tenant_test" VALUE="1"/>
				</ns:HOST>
			</ns:HOSTS>
		</ns:WSO2_CLOUD_MON>
	</soapenv:Body>
</soapenv:Envelope>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to