I suspect there's an HTTP protocol problem related to re-using a
connection following an upload.  Adam's code prevents HttpClient4 from
re-using connections.

By the way, the latest version of the Java library provides a method
OAuthClient.access that doesn't throw OAuthException.  You might find
it more useful than the invoke methods, for uploading (or any access
to protected resources).

On Mar 13, 1:04 pm, raid5 <[email protected]> wrote:
> It appears that initializing the OAuthClient with a HttpClientPool
> solves the issue. The issue appears to be related to how the Java
> OAuth library shared a single HttpClient but I'm not positive why this
> causes issues.
>
> Instead of:
> client = new OAuthClient(new HttpClient4());
>
> try:
> HttpClientPool pool = new HttpClientPool() {
>     public HttpClient getHttpClient(URL u) {
>         return new DefaultHttpClient();
>     }};
>
> client = new OAuthClient(new HttpClient4(pool));

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/oauth?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to