客户端与 axis2 1.6.1 连接时出现未知错误

发布于 2024-12-25 19:39:06 字数 3045 浏览 1 评论 0原文

我开发了一个使用 axis2 1.6.1 连接 Web 服务的客户端。但是,当一切都与 axis2 1.5.2 一起工作时,我遇到了以下错误

错误位于该行 _operationClient.execute(true); //在TestServiceStub内

[警告] 无法确定 jar:file:/D:/Test/TestClient/TestClient.jar 处 StAX 实现的方言!/ org.apache.axis2.AxisFault:com.ctc.wstx.exc.WstxUnexpectedCharException:意外字符“:”(代码58)例外空格,或“>”或“/>” 在[行,列{未知来源}]:[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)例外空格,或“>”或者 “/>” 在[行,列{未知来源}]:[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)空格除外,或“>”或“/>” 在[行,列{未知来源}]:[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 {未知来源}]: [1,199] 在 org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)

I developed a client connecting a web service with axis2 1.6.1. However, I encountered the following errors while everything works with axis2 1.5.2

The error is at the line
_operationClient.execute(true); //inside TestServiceStub

[WARN] Unable to determine dialect of the StAX implementation at jar:file:/D:/Test/TestClient/TestClient.jar!/
org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ':' (code 58) excepted space, or '>' or "/>"
at [row,col {unknown-source}]: [1,199]
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at my.dev.TestServiceStub.fromOM(TestServiceStub.java:2864)
at my.dev.TestServiceStub.test(TestServiceStub.java:192)
at my.dev.TestClient.main(TestClient.java:252)
Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ':' (code 58) excepted space, or '>' or
"/>"
at [row,col {unknown-source}]: [1,199]
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)
at org.apache.axiom.om.impl.SwitchingWrapper.updateNextNode(SwitchingWrapper.java:1099)
at org.apache.axiom.om.impl.SwitchingWrapper.(SwitchingWrapper.java:234)
at org.apache.axiom.om.impl.OMStAXWrapper.(OMStAXWrapper.java:73)
at org.apache.axiom.om.impl.llom.OMStAXWrapper.(OMStAXWrapper.java:52)
at org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader(OMElementImpl.java:795)
at org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReaderWithoutCaching(OMElementImpl.java:765)
at my.dev.TestServiceStub.fromOM(TestServiceStub.java:2858)
... 2 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ':' (code 58) excepted space, or '>' or "/>"
at [row,col {unknown-source}]: [1,199]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)
at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2965)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2936)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
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.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 9 more

Added code below and the warn was solved.

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");

However, I encountered another problem
org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ':' (code 58) excepted space, or '>' or "/>" at [row,col {unknown-source}]: [1,199] at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

原来分手还会想你 2025-01-01 19:39:06

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

The stack trace indicates that either the XML is malformed (there is a ':' character somewhere in a start tag that is not expected) or there is an issue with the XML parser. What version of Woodstox are you using? The warning "Unable to determine dialect of the StAX implementation" may indicate that the version you are using is not supported. I strongly recommend that you try to get rid of that warning (I'm actually the person who wrote the code that generates that warning). Otherwise you may encounter subtle issues in Axis2.

念﹏祤嫣 2025-01-01 19:39:06

如果您使用 SOAP WS,请在 Web 方法调用中检查 XML 请求参数。 XML 解析级别可能存在一些问题。

If you are using SOAP WS than check the XML request parameter at your web method call. There may be some problem at XML parsing level.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文