﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
7094	retrieving OAuth token failed due to HTTP 411 error	Larry0ua	team	"Steps to reproduce: 
1. Open Preferences
2. Select Connection Settings tab.
3. Select using OAuth
4. Enter your login/password, click Get Access
5. Error is displayed, console contains:
{{{
D:\temp\temp>""C:\Program Files (x86)\Java\jdk1.7.0\bin\java.exe"" -Xmx1G -jar josm-latest.jar
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2011-11-28 02:32:25
Last Changed Author: bastiK
Revision: 4616
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2011-11-27 23:10:38 +0100 (Sun, 27 Nov 2011)
Last Changed Rev: 4616

Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled.
GET http://api.openstreetmap.org/api/capabilities... OK
Communications with http://api.openstreetmap.org/api established using protocol version 0.6.
loading plugin 'reltoolbox' (version 26986)
loading plugin 'PicLayer' (version 27168)
loading plugin 'buildings_tools' (version 26731)
loading plugin 'FastDraw' (version 26986)
loading plugin 'GpxPoints' (version 26681)
loading plugin 'utilsplugin2' (version 26986)
loading plugin 'print' (version 27066)
Silent shortcut conflict: 'print:print' moved by 'tools:splitobject' to 'Ctrl+B'.
Registered toolbar action without name: org.openstreetmap.josm.plugins.print.PrintAction
Toolbar action without name: org.openstreetmap.josm.plugins.print.PrintAction
RemoteControl::Accepting connections on port 8111
Silent shortcut conflict: 'core_multikey:previousMarker' moved by 'tools:splitonintersections' to 'Shift+P'.
Toolbar action without name: org.openstreetmap.josm.plugins.print.PrintAction
org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 411 for URL: http://www.openstreetmap.org/oauth/request_token
        at org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationClient.getRequestToken(OsmOAuthAuthorizationClient.java:133)
        at org.openstreetmap.josm.gui.oauth.RetrieveRequestTokenTask.realRun(RetrieveRequestTokenTask.java:79)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:79)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:125)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 411 for URL: http://www.openstreetmap.org/oauth/request_token
        at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
        at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
        at org.openstreetmap.josm.gui.oauth.OsmOAuthAuthorizationClient.getRequestToken(OsmOAuthAuthorizationClient.java:128)
        ... 9 more
Caused by: java.io.IOException: Server returned HTTP response code: 411 for URL: http://www.openstreetmap.org/oauth/request_token
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1661)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1659)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1657)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1240)
        at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnectionResponseAdapter.java:18)
        at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:228)
        at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189)
        ... 11 more
Caused by: java.io.IOException: Server returned HTTP response code: 411 for URL: http://www.openstreetmap.org/oauth/request_token
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1612)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
        at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getStatusCode(HttpURLConnectionResponseAdapter.java:22)
        at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:178)
        ... 11 more
}}}

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.12 : 
411 Length Required

The server refuses to accept the request without a defined Content- Length. The client MAY repeat the request if it adds a valid Content-Length header field containing the length of the message-body in the request message. "	defect	closed	normal	16.01	Core	latest	fixed	oauth, 411	
