迭代介体中的错误:Axis2Sender发送消息时出现意外错误org.apache.axis2.AxisFault

时间:2014-05-27 07:19:15

标签: nullpointerexception wso2 wso2esb axis2 wso2dss

我正在使用wso2esb 4.7.0和wso2dss 3.0.0。我已经创建了一个代理服务,并希望使用有效负载工厂中介显示消息。我的配置包含迭代器中介。我必须在表中插入值数组然后显示像Rows一样成功插入数据库的消息。我在insequence中的迭代配置如下:

  <iterate continueParent="true"
                  id="Readings"
                  expression="//ReadingsLiteTaildto">
            <target>
               <sequence>
                  <property name="userid" expression="get-property('userid')"/>
                  <property name="usergroupid" expression="get-property('usergroupid')"/>
                  <property name="slno" expression="//slno/text()"/>
                  <property name="type" expression="//type/text()"/>
                  <payloadFactory>
                     <format>
                        <p:Capp_musergroupdetails_insertion_op xmlns:p="http://ws.wso2.org/dataservice">
                           <p:usergroupid>$1</p:usergroupid>
                           <p:slno>$2</p:slno>
                           <p:userid>$3</p:userid>
                           <p:type>$4</p:type>
                        </p:Capp_musergroupdetails_insertion_op>
                     </format>
                     <args>
                        <arg evaluator="xml" expression="get-property('usergroupid')"/>
                        <arg evaluator="xml" expression="get-property('slno')"/>
                        <arg evaluator="xml" expression="get-property('userid')"/>
                        <arg evaluator="xml" expression="get-property('type')"/>
                     </args>
                  </payloadFactory>
                  <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
                  <property name="messageType" value="application/json" scope="axis2"/>
                  <send receive="Capp_UserGroupDetail_Seq">
                     <endpoint>
                        <address uri="http://192.168.1.23:9764/services/CappMuserDataservice/"/>
                     </endpoint>
                  </send>
               </sequence>
            </target>
         </iterate>

顺序配置是:

equence xmlns="http://ws.apache.org/ns/synapse" name="Capp_UserGroupDetail_Seq" onError="fault">
   <property name="CONTENT_TYPE" value="application/json" scope="axis2" type="STRING"/>
   <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
   <property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
   <property name="RESPONSE" value="true" scope="default" type="STRING"/>
   <property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
   <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:h="http://ws.wso2.org/dataservice" name="usergroupdetailid" expression="//usergroupdetailid/text()" scope="default" type="STRING"/>
   <log>
      <property xmlns:ns="http://org.apache.synapse/xsd" name="usergroupdetailid" expression="get-property('usergroupdetailid')"/>
      <property xmlns:ns="http://org.apache.synapse/xsd" name="usergroupid" expression="get-property('usergroupid')"/>
      <property xmlns:ns="http://org.apache.synapse/xsd" name="userid" expression="get-property('userid')"/>
   </log>
   <payloadFactory>
      <format>
         <ResponseJSON xmlns="">
            <Body>
               <Datalist>
                  <Data>Successfully Rows inserted</Data>
               </Datalist>
            </Body>
            <Status>200</Status>
         </ResponseJSON>
      </format>
   </payloadFactory>
   <log level="full"/>
   <property name="messageType" value="application/json" scope="axis2"/>
   <send/>
   <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true" scope="default" type="STRING"/>
</sequence>

但它在服务器端出错,如:

INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:be41c3c9-f9c1-4ce9-933e-78b48e215601, Direction: response, usergroupdetailid = 370568479314543786, usergroupid = 370568478945445032, userid = 370568478735729831
[2014-05-27 12:23:25,165]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:be41c3c9-f9c1-4ce9-933e-78b48e215601, Direction: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ResponseJSON><Body><Datalist><Data>Successfully Rows inserted</Data></Datalist></Body><Status>200</Status></ResponseJSON></soapenv:Body></soapenv:Envelope>
[2014-05-27 12:23:25,167]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:06cf72eb-2aed-483b-81ce-3cbfefd0f511, Direction: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><Body/></soapenv:Envelope>
[2014-05-27 12:23:25,167] ERROR - PassThroughHttpSender Failed to submit the response
java.lang.NullPointerException
    at org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeEndDocument(MappedXMLStreamWriter.java:189)
    at org.apache.axis2.json.AbstractJSONMessageFormatter.writeTo(AbstractJSONMessageFormatter.java:194)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:440)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:254)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
    at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:161)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:308)
    at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:92)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:239)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:222)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:679)
[2014-05-27 12:23:25,168] ERROR - Axis2Sender Unexpected error sending message back
org.apache.axis2.AxisFault: Failed to submit the response
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:501)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:256)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
    at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:161)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:308)
    at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:92)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:239)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
    at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:222)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.NullPointerException
    at org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeEndDocument(MappedXMLStreamWriter.java:189)
    at org.apache.axis2.json.AbstractJSONMessageFormatter.writeTo(AbstractJSONMessageFormatter.java:194)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:440)
    at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:254)
    ... 15 more
[2014-05-27 12:23:25,169]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:ba684be3-b7bc-46bd-9c21-66495061c97d, Direction: response, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = 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"><Body/></soapenv:Envelope>

他们的问题是顺序还是其他任何问题?请告诉我。

1 个答案:

答案 0 :(得分:1)

NullPointerException是由空响应引起的:Soap body是空的(参见第3个日志条目),与application / json(org.apache.axis2.json.JSONMessageFormatter)关联的消息格式化程序无法处理它