﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3072	"JOSM keeps trying to upload while the API throws ""HTTP/1.1 401 Unauthorized"" and internal errors"	avarab@…	team	"Here's log of JOSM talking to my broken test API. I configured the wrong password in JOSM preferences so that the API throws ""HTTP/1.1 401 Unauthorized"" errors when JOSM tries to create changesets. JOSM disregards this and keeps on trying to create changesets.

Even though the server always throws either 401 or 500 JOSM seems to get the idea that it already uploaded the changeset content (which it didn't) and tries to close the changeset. Then it throws a NullPointerException:

{{{
org.openstreetmap.josm.io.OsmTransferException: java.lang.NullPointerException
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:475)
	at org.openstreetmap.josm.io.OsmApi.stopChangeset(OsmApi.java:304)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:115)
	at org.openstreetmap.josm.actions.UploadAction$1UploadDiffTask.realRun(UploadAction.java:227)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:62)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:116)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:458)
	... 8 more
org.openstreetmap.josm.io.OsmTransferException: java.lang.NullPointerException
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:475)
	at org.openstreetmap.josm.io.OsmApi.createPrimitive(OsmApi.java:232)
	at org.openstreetmap.josm.io.OsmApi.createChangeset(OsmApi.java:289)
	at org.openstreetmap.josm.io.OsmServerWriter.uploadOsm(OsmServerWriter.java:108)
	at org.openstreetmap.josm.actions.UploadAction$1UploadDiffTask.realRun(UploadAction.java:227)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:62)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:116)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
	at org.openstreetmap.josm.io.OsmApi.sendRequest(OsmApi.java:458)
	... 9 more
}}}"	defect	closed	major		Core		worksforme		
