1
votes

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)

2

2 Answers

3
votes

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.

0
votes

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.