我开发了一个将Web服务与axis2 1.6.1连接的客户端。但是,在axis2 1.5.2正常运行时遇到以下错误

错误在行
_operationClient.execute(true); //inside TestServiceStub


  [WARN]无法在jar:file:/ D:/Test/TestClient/TestClient.jar!/下确定StAX实现的方言!
  org.apache.axis2.AxisFault:com.ctc.wstx.exc.WstxUnexpectedCharException:意外字符':'(代码58),空格除外,或'>'或“ />”
   在[row,col {unknown-source}]:[1,199]
          在org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
          在my.dev.TestServiceStub.fromOM(TestServiceStub.java:2864)
          在my.dev.TestServiceStub.test(TestServiceStub.java:192)
          在my.dev.TestClient.main(TestClient.java:252)
  由以下原因引起:org.apache.axiom.om.OMException:com.ctc.wstx.exc.WstxUnexpectedCharException:意外字符':'(代码58),空格或'>'除外
   “ />”
   在[row,col {unknown-source}]:[1,199]
          在org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)
          在org.apache.axiom.om.impl.SwitchingWrapper.updateNextNode(SwitchingWrapper.java:1099)
          在org.apache.axiom.om.impl.SwitchingWrapper中(SwitchingWrapper.java:234)
          在org.apache.axiom.om.impl.OMStAXWrapper。(OMStAXWrapper.java:73)
          在org.apache.axiom.om.impl.llom.OMStAXWrapper。(OMStAXWrapper.java:52)
          在org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader(OMElementImpl.java:795)
          在org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReaderWithoutCaching(OMElementImpl.java:765)
          在my.dev.TestServiceStub.fromOM(TestServiceStub.java:2858)
          ...另外2个
  引起原因:com.ctc.wstx.exc.WstxUnexpectedCharException:意外字符':'(代码58),空格除外,或者'>'或“ />”
   在[row,col {unknown-source}]:[1,199]
          在com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)
          在com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2965)
          在com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2936)
          在com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
          在com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
          在org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
          在org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
          在org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)
          在org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
          ...另外9个


在下面添加了代码,警告已解决。

System.setProperty(“ javax.xml.stream.XMLInputFactory”,“ com.ctc.wstx.stax.WstxInputFactory”); System.setProperty(“ javax.xml.stream.XMLOutputFactory”,“ com.ctc.wstx.stax.WstxOutputFactory”); System.setProperty(“ javax.xml.stream.XMLEventFactory”,“ com.ctc.wstx.stax.WstxEventFactory”);

但是,我遇到了另一个问题
org.apache.axis2.AxisFault:com.ctc.wstx.exc.WstxUnexpectedCharException:意外字符':'(代码58),空格除外,或[row,col {unknown-source}]处的'>'或“ />” :[1,199],位于org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)

最佳答案

堆栈跟踪表明XML格式不正确(开始标记中某处不存在':'字符,这是不期望的)或XML解析器存在问题。您正在使用哪个版本的Woodstox?警告“无法确定StAX实现的方言”可能表明不支持您使用的版本。我强烈建议您尝试消除该警告(实际上,我是编写生成该警告的代码的人)。否则,您可能会在Axis2中遇到细微的问题。

关于java - 客户端与axis2 1.6.1建立连接时发生未知错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8786227/

10-10 06:30