Friday, July 19, 2013

XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]

100/100 times I know that this exception happens while there is a parse error in your xml and there is something wrong at the specified row and column.

Knowing the following exception is due to an XML parse error, recently I was puzzled for a while trying to look into the actual content of the file.  I couldn't see any closing tag error at the row and column mentioned.

After looking closer, I figured out my xml is used by multiple threads where a few threads were trying to write the XML and the other was trying to read the same file. And the exception was due to thread safety and the file was not fully written before the read. :-)

Message: XML document structures must start and end within the same entity.
com.sun.xml.internal.ws.streaming.XMLStreamReaderException: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8829,4]
Message: XML document structures must start and end within the same entity.
at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:256)
at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.skipTags(XMLStreamReaderUtil.java:146)
at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.skipElement(XMLStreamReaderUtil.java:119)
at com.sun.xml.internal.ws.wsdl.parser.WSDLParserExtensionFacade.definitionsElements(WSDLParserExtensionFacade.java:129)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:314)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:135)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:254)
at com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:217)
at com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:165)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)

No comments:

Post a Comment