在wso2esb中构建Passthrough流错误时RelayUtils出错

时间:2014-04-11 10:15:52

标签: wso2esb wso2carbon wso2dss

我正在使用wso2esb 4.7.0和wso2dss 3.0.0 ..我在wso2dss中编写了一个查询。它在dss中运行正常。另外,但是当我希望在序列介体中使用wso2esb 时,它会显示错误,如上所述

 ERROR - RelayUtils Error while building Passthrough stream
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
    at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73)
    at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79)
    at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196)
    at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55)
    at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:118)
    at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:116)
    at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:91)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:62)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:232)
    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: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)
    at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2116)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2022)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1114)
    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.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
    ... 20 more

        .
        .

我的代理服务是:

<inSequence>
         <property name="messageType" value="application/json" scope="axis2"/>
         <property name="username"
                   expression="//username/text()"
                   scope="default"
                   type="STRING"/>
         <property name="userid"
                   expression="//userid/text()"
                   scope="default"
                   type="STRING"/>
         <log>
            <property name="username" expression="get-property('username')"/>
            <property name="userid" expression="get-property('userid')"/>
         </log>
         <payloadFactory media-type="xml">
            <format>
               <p:trail_op xmlns:p="http://ws.wso2.org/dataservice">
                  <p:username>$1</p:username>
                  <p:userid>$2</p:userid>
               </p:trail_op>
            </format>
            <args>
               <arg evaluator="xml" expression="get-property('username')"/>
               <arg evaluator="xml" expression="get-property('userid')"/>
            </args>
         </payloadFactory>
         <header name="Action" value=""/>
         <property name="SOAPAction" value="" scope="transport"/>
         <send receive="Capp_Login_seq1">
            <endpoint>
               <address uri="http://192.168.1.23:9764/services/Capp_muser_dataservice/"
                        format="soap12"/>
            </endpoint>
         </send>
         <log level="full"/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>

和序列是:

 <sequence xmlns="http://ws.apache.org/ns/synapse" name="Capp_Login_seq1">
   <property name="messageType" value="application/json" scope="axis2"/>
   <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:s="http://ws.wso2.org/dataservice" name="userid" expression="get-property('userid')" scope="default" type="STRING"/>
   <log>
      <property xmlns:ns="http://org.apache.synapse/xsd" name="userid" expression="get-property('userid')"/>
   </log>
   <send/>
</sequence>

我发送的请求如下:

curl -v -H "Accept:application/json" -H "Content-Type:application/json"  -d '{"username":"Harry","userid":"347367127872701992"}' http://youtility-desktop:8282/services/Capp_LoginProxy

我该如何修复错误?请让我知道..

1 个答案:

答案 0 :(得分:0)

我在ESB 5和DAS 3中遇到了同样的问题。可以通过在esb / repository / conf / axis2.xml中的axis2.xml中添加相关的messageFormatters和messageBuilders来修复它。

在我的方案中,这两个条目已添加到axis2.xml

messageFormatter contentType =“text / html”                 类= “org.wso2.carbon.relay.ExpandingMessageFormatter”/&GT;

messageBuilder contentType =“text / html”class =“org.wso2.carbon.relay.BinaryRelayBuilder”/&gt;