2016-03-22 13 views
0

WSO2 ESB 4.9.0でAPIを作成しようとしていますが、JPEG形式の画像を返す必要があります。WSO2 ESBを使用しているときにGZIP出力ストリームを取得中にエラーが発生する

しかし、私はこのエラーが発生しています。原因:org.apache.axis2.AxisFault:GZIP出力ストリームを取得中にエラーが発生しました。

したがって、WSO2 ESBのGZIP圧縮をimage/jpegメッセージタイプに対してオフにすることはできますか?

TID: [-1234] [] [2016-03-23 08:17:09,833] ERROR {org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator} - Error getting GZIP output stream {org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator} org.apache.axis2.AxisFault: Invalid null character in text to output at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) at org.apache.axis2.transport.http.ApplicationXMLFormatter.writeTo(ApplicationXMLFormatter.java:146) at org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator.writeTo(GzipMessageFormatterDecorator.java:66) at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:552) 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.rest.Resource.process(Resource.java:297) at org.apache.synapse.rest.API.process(API.java:335) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:97) at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:52) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:266) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.ctc.wstx.exc.WstxIOException: Invalid null character in text to output at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:462) at org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeCharacters(MTOMXMLStreamWriter.java:289) at org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:250) at org.apache.axiom.om.impl.llom.OMTextImpl.internalSerialize(OMTextImpl.java:415) at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562) at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875) at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193) at org.apache.axis2.transport.http.ApplicationXMLFormatter.writeTo(ApplicationXMLFormatter.java:143) ... 23 more Caused by: java.io.IOException: Invalid null character in text to output at com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:51) at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:623) at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:554) at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:460) ... 30 more TID: [-1234] [] [2016-03-23 08:17:09,838] ERROR {org.apache.synapse.transport.passthru.PassThroughHttpSSLSender} - Failed to submit the response {org.apache.synapse.transport.passthru.PassThroughHttpSSLSender} org.apache.axis2.AxisFault: Error getting GZIP output stream at org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator.handleException(GzipMessageFormatterDecorator.java:95) at org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator.writeTo(GzipMessageFormatterDecorator.java:76) at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:552) 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.rest.Resource.process(Resource.java:297) at org.apache.synapse.rest.API.process(API.java:335) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:97) at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:52) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:266) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.axis2.AxisFault: Invalid null character in text to output at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) at org.apache.axis2.transport.http.ApplicationXMLFormatter.writeTo(ApplicationXMLFormatter.java:146) at org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator.writeTo(GzipMessageFormatterDecorator.java:66) ... 22 more Caused by: com.ctc.wstx.exc.WstxIOException: Invalid null character in text to output at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:462) at org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeCharacters(MTOMXMLStreamWriter.java:289) at org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:250) at org.apache.axiom.om.impl.llom.OMTextImpl.internalSerialize(OMTextImpl.java:415) at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562) at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875) at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193) at org.apache.axis2.transport.http.ApplicationXMLFormatter.writeTo(ApplicationXMLFormatter.java:143) ... 23 more Caused by: java.io.IOException: Invalid null character in text to output at com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:51) at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:623) at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:554) at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:460) ... 30 more TID: [-1234] [] [2016-03-23 08:17:09,841] ERROR {org.apache.synapse.core.axis2.Axis2Sender} - Content-Encoding:gzip,Content-Type:image/jpeg,Vary:Accept-Encoding, Unexpected error sending message back {org.apache.synapse.core.axis2.Axis2Sender} 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.rest.Resource.process(Resource.java:297) at org.apache.synapse.rest.API.process(API.java:335) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:97) at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:52) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:266) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.axis2.AxisFault: Error getting GZIP output stream at org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator.handleException(GzipMessageFormatterDecorator.java:95) at org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator.writeTo(GzipMessageFormatterDecorator.java:76) at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:552) at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:267) ... 20 more Caused by: org.apache.axis2.AxisFault: Invalid null character in text to output at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) at org.apache.axis2.transport.http.ApplicationXMLFormatter.writeTo(ApplicationXMLFormatter.java:146) at org.apache.synapse.transport.nhttp.util.GzipMessageFormatterDecorator.writeTo(GzipMessageFormatterDecorator.java:66) ... 22 more Caused by: com.ctc.wstx.exc.WstxIOException: Invalid null character in text to output at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:462) at org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeCharacters(MTOMXMLStreamWriter.java:289) at org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:250) at org.apache.axiom.om.impl.llom.OMTextImpl.internalSerialize(OMTextImpl.java:415) at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:562) at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875) at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193) at org.apache.axis2.transport.http.ApplicationXMLFormatter.writeTo(ApplicationXMLFormatter.java:143) ... 23 more Caused by: java.io.IOException: Invalid null character in text to output at com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:51) at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:623) at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:554) at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:460) ... 30 more TID: [-1234] [] [2016-03-23 08:17:09,844] ERROR {org.apache.synapse.mediators.builtin.LogMediator} - Could not build full log message: Can not serialize OM Element Envelope {org.apache.synapse.mediators.builtin.LogMediator} TID: [-1234] [] [2016-03-23 08:17:09,845] ERROR {API_LOGGER.Photos} - Could not build full log message: Can not serialize OM Element Envelope {API_LOGGER.Photos} TID: [-1234] [] [2016-03-23 08:17:09,850] INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: http://www.w3.org/2005/08/addressing/anonymous , WSAction: , SOAPAction: , MessageID: urn:uuid:e4e1882c-6a04-4c77-b802-0aaf7d5f73cb, Direction: response, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Content-Encoding:gzip,Content-Type:image/jpeg,Vary:Accept-Encoding, Unexpected error sending message back, Envelope: {org.apache.synapse.mediators.builtin.LogMediator}

+0

フルエラーログを共有できます –

+0

これはうまくいきませんが、catalina-server.xmlからimage/jpegを削除して確認できますか? –

+0

申し訳ありませんが、動作しませんでした。私はログを追加しています。 – zygimantus

答えて

0

エラーログで判断すると、ESBはアプリケーション/ xmlとして画像を解析しています。したがって、/repository/conf/axis2/axis2.xmlファイルで設定エラーが発生した可能性があります。

<messageBuilder contentType="image/jpeg" class="org.wso2.carbon.relay.BinaryRelayBuilder" /> 
<messageFormatter contentType="image/jpeg" class="org.wso2.carbon.relay.ExpandingMessageFormatter" /> 

も参照してください:http://sachirajapakse.blogspot.nl/2015/10/send-images-for-rest-api-in-wso2-esb.html

* org.apache.axis2.transport.http.ApplicationXMLFormatter.writeTo(ApplicationXMLFormatter.java

ビルダーとフォーマッタは、次のように定義する必要があります:143)... 23 more原因:java.io.IOException:(..)で出力するテキストの無効なヌル文字