Thursday, 19 March 2015

How to setting proxy for osmosis?


I'm trying to use osmosis to update my data ( http://wiki.openstreetmap.org/wiki/Minutely_Mapnik ) but I'm facing the follow error:


org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to read the state from the server.
at org.openstreetmap.osmosis.replication.common.ServerStateReader.getServerState(ServerStateReader.java:116)
at org.openstreetmap.osmosis.replication.common.ServerStateReader.getServerState(ServerStateReader.java:50)
at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.runImpl(BaseReplicationDownloader.java:290)

at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.run(BaseReplicationDownloader.java:383)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Server returned HTTP response code: 407 for URL: http://planet.openstreetmap.org/replication/hour/state.txt
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at org.openstreetmap.osmosis.replication.common.ServerStateReader.getServerState(ServerStateReader.java:97)
... 4 more

jul 28, 2016 8:26:55 AM org.openstreetmap.osmosis.core.Osmosis main
GRAVE: Execution aborted.

org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)

at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

I'm already done export JAVACMD_OPTIONS="-Dhttp.proxyHost=MY_PROXY -Dhttp.proxyPort=6060 -Dhttp.proxyUser=MY_USER-Dhttp.proxyPassword=MY_PASSWORD" but with no success. I'm able to access this URL using the browser.


I know... 407 is for Authentication. The setting I'm using is correct for sure or my browser will give same error.


One more information: as seen in (How to configure Geoserver to use a proxy when accessing external services?) I'm facing same problem in Geoserver. SOME external WMS services gives me same 407 error, others don't.


I think this is because of proxy auth implementation inside the code (osmosis and geoserver may be using same method): https://stackoverflow.com/questions/17183277/http-error-407-proxy-authentication-required




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...