SomeoneElseOSM/Notes01

SAXParseException

Closed this issue · 6 comments

After starting the jar with
java -jar Notes01.jar -do_notes -bbox=-22.09033,64.04443,-21.63253,64.18436 -output_gpx=notes-Reykjavik.gpx
I get the following output:

[Fatal Error] :1:50: White spaces are required between publicId and systemId.
Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 50; White spaces are required between publicId and systemId.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
        at Notes01.process_notes_url_common(Notes01.java:1046)
        at Notes01.process_notes(Notes01.java:1092)
        at Notes01.main(Notes01.java:1605)

I use the release version from 2016-08-14.
Maybe the api changed since then?
It would be great if I could use this downloader but I am not able to fix this myself.

I don't think it's an API problem as such, since I use a command line similar to yours every few days. My guess is that it's either the output for Reykjavik has non-US-ASCII characters in it that breaks things somehow / sometimes, or that it's a different Java or OS that's causing an issue. I've just tried your command line where I am now (Windows 10) and it works:

java -jar Notes01.jar -do_notes -bbox=-22.09033,64.04443,-21.63253,64.18436 -output_gpx=notes-Reykjavik.gpx
Notes found: 100

The Java I'm using where I am now is from https://chocolatey.org/packages/openjdk . It was checked for update yesterday and appears to be about 3 weeks old. What version of Java and what OS are you using?

Thanks for the quick feedback. I am using Fedora (Linux) with openjdk 1.8. When using with much smaller area (probably includes no notes), same problem exists:

java -jar Notes01.jar -do_notes -bbox=-22.09033,64.04443,-22.08000,64.05000 -output_gpx=notes-Reykjavik.gpx

Now I downloaded the repo, installed javac version 1.8.0_272, compiled with javac Notes01.java and ran with java Notes01 -do_fixmes -notes_closed=0 -notes_limit=1000 -do_notes -bbox=-22.09033,64.04443,-21.63253,64.18436 -output_gpx=notes-Reykjavik.gpx and it works perfectly. No idea where the change came from but maybe it's somewhere in the last 4 commitst that are newer than the last release?

When I go back to the tag v0.0.6 I get my error again. So the changes in the urls fixed the error. Hence, it would be great if you could make a new release with the current code and that should fix it.

Thanks for the quick reply that motivated me to investigate myself!

The culprit is e422a61 , I think. My memory suggests that Java doesn't follow redirects, so an attempt to get anything from the OSM API via http will just get nothing useful.

I'd somewhat forgotten I'd created releases for this at all - next time I'm in a position to I'll create a new one.