[osmosis-dev] osmosis wrongly claims to see UTF8 problem
Brett Henderson
brett at bretth.com
Wed Jan 11 21:44:54 UTC 2017
If the file is valid then perhaps it's a bug in the Xerces parser bundled
with Osmosis. The JDK version you use shouldn't matter because I don't use
its XML parser (Java bundles an ancient version of Xerces with more serious
unicode bugs).
I don't have any suggestions other than to check if there's a later version
of Xerces available. To change it, modify the following file:
https://github.com/openstreetmap/osmosis/blob/master/gradle.properties
Change this line:
dependencyVersionXerces=2.9.1
I see I added the following comments above that line which explains why I
haven't upgraded it yet.
# Remaining on 2.9.1 instead of 2.10.0 for now because the newer version
# depends on org.w3c.dom.ElementTraversal which is not being transitively
# included. This could be possibly be fixed by including a newer version
# of xml-apis but this hasn't been verified.
Perhaps it's currently using the JDK version of xml-apis, but we may need
to explicitly include a later version of that as well. Ugh. As an aside,
I think Java 9 is supposed to be fixing some of this bundled dependency
mess and allowing a newer XML library to be included.
I'd offer to help but I just don't have time. Osmosis isn't getting much
love from me any more :-(
On Wed, 11 Jan 2017 at 20:33 Frederik Ramm <frederik at remote.org> wrote:
> Hi,
>
> On 01/11/2017 10:30 AM, Frederik Ramm wrote:
> > SEVERE: Thread for task 1-read-xml-change failed
>
> I was a bit over-eager in shortening the stack trace. Full detail:
>
> org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to parse
> xml file x.osc. publicId=(null), systemId=(null), lineNumber=583379,
> columnNumber=90.
> at
>
> org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader.run(XmlChangeReader.java:114)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.xml.sax.SAXParseException; lineNumber: 583379;
> columnNumber: 90; Invalid byte 2 of 4-byte UTF-8 sequence.
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> at
>
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> at
> org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
> at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
> at
>
> org.openstreetmap.osmosis.xml.v0_6.XmlChangeReader.run(XmlChangeReader.java:109)
> ... 1 more
> Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException:
> Invalid byte 2 of 4-byte UTF-8 sequence.
> at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown
> Source)
> at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
> at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
> at org.apache.xerces.impl.XMLEntityScanner.scanLiteral(Unknown
> Source)
> at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown
> Source)
> at
>
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
> ... 11 more
>
> --
> Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
>
> _______________________________________________
> osmosis-dev mailing list
> osmosis-dev at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osmosis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20170111/6f65670f/attachment.html>
More information about the osmosis-dev
mailing list