WSO2 ESB 4.8.1错误publicId和systemId之间需要空格

时间:2015-04-23 10:54:35

标签: wso2 axis2 doctype synapse axiom

我们正在使用WAV2 ESB 4.8.1和JAVA 1.7.0_55。总是,当我们启动ESB并发出第一个请求时,我们会收到此错误:

TID: [0] [ESB] [2015-04-22 10:51:31,067] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils}
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,62]
Message: White spaces are required between publicId and systemId.
                at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
                at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)
                at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570)
                at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566)
                at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:129)
                at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:107)
                at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
                at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
                at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
                at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
                at org.apache.synapse.rest.Resource.process(Resource.java:297)
                at org.apache.synapse.rest.API.process(API.java:298)
                at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
                at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:50)
                at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
                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]:[1,62]
Message: White spaces are required between publicId and systemId.
                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)
                ... 22 more
TID: [0] [ESB] [2015-04-22 10:51:31,073] ERROR {org.apache.synapse.mediators.base.SequenceMediator} -  Error while building message {org.apache.synapse.mediators.base.SequenceMediator}
org.apache.axis2.AxisFault: Error while building Passthrough stream
                at org.apache.synapse.transport.passthru.util.RelayUtils.handleException(RelayUtils.java:236)
                at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:111)
                at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
                at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
                at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
                at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
                at org.apache.synapse.rest.Resource.process(Resource.java:297)
                at org.apache.synapse.rest.API.process(API.java:298)
                at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
                at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:50)
                at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
                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: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,62]
Message: White spaces are required between publicId and systemId.
                at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
                at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)
                at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570)
                at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566)
                at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:129)
                at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:107)
                ... 17 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,62]
Message: White spaces are required between publicId and systemId.
                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)
                ... 22 more

在此之后,我们提出同样的要求,一切正常......

为避免此错误有任何建议吗?

1 个答案:

答案 0 :(得分:0)

使用此错误分析响应时,我们看到了以下消息的响应:

"Error Code: 502 Proxy Error. The ISA Server denied the specified Uniform Resource Locator (URL).

在调试源代码ESB之后,我们在'synapse-nhttp-transport'类中看到了一个错误,尽管'nonProxyHosts'中包含文件/repository/conf/axis2/axis2.xml值,但第一次调用是总是通过代理发送。

代理本身就是削减流量的人,产生的错误是由它的反应所驱动的。

要修复已经创建了一个修改类的补丁,请按如下方式保留:

public HttpHost selectProxy(final HttpHost target) {
  if (this.proxy != null) {
    if (knownProxyHosts.contains(target.getHostName().toLowerCase(Locale.US))) {
      return this.proxy;
    } else if (knownProxyHosts.contains(target,getHostName().toLowerCase(Locale.US))) {
      return null;
    } else {
      // we are encountering this host for the first time
      if (!isByPass(target.getHostName().toLowerCase(Locale.US))) {
        return this.proxy;
      } else {
        return null;
      }   
    }
  }
  return this.proxy;
}

此外,已通知WSO2更正此错误。