<div dir="ltr">I suspect that attempting to detect the underlying XML runtime would be brittle.  Another option might be to embed that bit of data in Osmosis itself and do a self test before attempting to execute any XML tasks.<br><br>I'm surprised that this is still an issue in standard Java.  I tried raising tickets against Sun Java before it moved under Oracle but never got a response.  I gave up, embedded Xerces in the main Osmosis distribution, and then forgot about it.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 March 2015 at 10:16, Jochen Topf <span dir="ltr"><<a href="mailto:jochen@remote.org" target="_blank">jochen@remote.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
Just spent a few hours debugging this problem: The way Osmosis is packaged<br>
on Debian Jessie seems to be wrong. It doesn't use the Xerces XML parser<br>
but seems to fall back to Java default XML parser which mangles Unicode<br>
characters.<br>
<br>
This can lead to data corruption (and has for me today) when using Osmosis<br>
for planet updates etc.<br>
<br>
You can test whether this bug is on your system, too: Download the XML<br>
for this node: <a href="http://www.openstreetmap.org/node/3382756758" target="_blank">http://www.openstreetmap.org/node/3382756758</a>. Then run<br>
it through osmosis:<br>
<br>
    osmosis --rx 3382756758.osm --wx out.osm<br>
<br>
Compare the two files, you'll see the musical notation character doubling<br>
in the second case when your Osmosis is broken. The fix is simple: Add<br>
a line "load /usr/share/java/xercesImpl.jar" to /etc/osmosis/plexus.conf.<br>
As I understand this, it tells Java to load Xerces replacing the built-in<br>
XML parser.<br>
<br>
I have opened a bug with Debian.<br>
<br>
Arguably Osmosis should somehow detect when Xerces isn't found and return an<br>
error instead of using a different implemenation. But I don't know enough about<br>
Java to say whether thats possible.<br>
<span class="HOEnZb"><font color="#888888"><br>
Jochen<br>
--<br>
Jochen Topf  <a href="mailto:jochen@remote.org">jochen@remote.org</a>  <a href="http://www.jochentopf.com/" target="_blank">http://www.jochentopf.com/</a>  <a href="tel:%2B49-173-7019282" value="+491737019282">+49-173-7019282</a><br>
<br>
_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/dev" target="_blank">https://lists.openstreetmap.org/listinfo/dev</a><br>
</font></span></blockquote></div><br></div>