Are you using the OAuth Java library with HttpClient 4 ?

If you are using HttpClient 4.x (or Http Client 3.x), you can enable
trace level logging
by adding this static initializer to your app:

static

{

System.getProperties().put("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");

System.getProperties().put("org.apache.commons.logging.simplelog.defaultlog",
"trace");

}


The trace output should help you debug this.

Sean


On Tue, Jan 20, 2009 at 10:33 AM, Tane Piper
<[email protected]> wrote:
>
> Hey folks,
>
> I'm adding some new features to my app - but have had some weird
> results recently.  In my new feature, I use OAuth to post a note to
> the Brightkite service.  I'm getting the exact same result each time
> here.  When I open the activity and try to post, I have to do it
> twice, every time.  And every time I get the exact same errors:
>
> 01-20 09:25:41.016: WARN/System.err(19409):
> org.apache.http.client.ClientProtocolException
> 01-20 09:25:41.026: WARN/System.err(19409):     at
> org.apache.http.impl.client.AbstractHttpClient.execute
> (AbstractHttpClient.java:557)
> 01-20 09:25:41.036: WARN/System.err(19409):     at
> org.apache.http.impl.client.AbstractHttpClient.execute
> (AbstractHttpClient.java:487)
> 01-20 09:25:41.036: WARN/System.err(19409):     at
> org.apache.http.impl.client.AbstractHttpClient.execute
> (AbstractHttpClient.java:465)
> 01-20 09:25:41.046: WARN/System.err(19409):     at
> net.oauth.client.httpclient4.HttpClient4.execute(HttpClient4.java:89)
> 01-20 09:25:41.056: WARN/System.err(19409):     at
> net.oauth.client.OAuthClient.invoke(OAuthClient.java:260)
> 01-20 09:25:41.056: WARN/System.err(19409):     at
> net.oauth.client.OAuthClient.invoke(OAuthClient.java:160)
> 01-20 09:25:41.066: WARN/System.err(19409):     at
> org.ifies.brightroid.oauth.AndroidAccessor.postMessage
> (AndroidAccessor.java:76)
> 01-20 09:25:41.066: WARN/System.err(19409):     at
> org.ifies.brightroid.me.PostNote$2.run(PostNote.java:77)
> 01-20 09:25:41.076: WARN/System.err(19409):     at
> android.os.Handler.handleCallback(Handler.java:542)
> 01-20 09:25:41.076: WARN/System.err(19409):     at
> android.os.Handler.dispatchMessage(Handler.java:86)
> 01-20 09:25:41.086: WARN/System.err(19409):     at
> android.os.Looper.loop(Looper.java:123)
> 01-20 09:25:41.086: WARN/System.err(19409):     at
> android.app.ActivityThread.main(ActivityThread.java:3742)
> 01-20 09:25:41.096: WARN/System.err(19409):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 01-20 09:25:41.096: WARN/System.err(19409):     at
> java.lang.reflect.Method.invoke(Method.java:515)
> 01-20 09:25:41.106: WARN/System.err(19409):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:739)
> 01-20 09:25:41.106: WARN/System.err(19409):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
> 01-20 09:25:41.116: WARN/System.err(19409):     at
> dalvik.system.NativeStart.main(Native Method)
> 01-20 09:25:41.116: WARN/System.err(19409): Caused by:
> org.apache.http.client.NonRepeatableRequestException: Cannot retry
> request with a non-repeatable request entity
> 01-20 09:25:41.136: WARN/System.err(19409):     at
> org.apache.http.impl.client.DefaultRequestDirector.execute
> (DefaultRequestDirector.java:402)
> 01-20 09:25:41.136: WARN/System.err(19409):     at
> org.apache.http.impl.client.AbstractHttpClient.execute
> (AbstractHttpClient.java:555)
> 01-20 09:25:41.146: WARN/System.err(19409):     ... 16 more
>
>
> 01-20 09:26:18.196: WARN/System.err(19409):
> net.oauth.OAuthProblemException: HTTP/1.1 201 Created
> 01-20 09:26:18.206: WARN/System.err(19409):     at
> net.oauth.client.OAuthClient.invoke(OAuthClient.java:264)
> 01-20 09:26:18.216: WARN/System.err(19409):     at
> net.oauth.client.OAuthClient.invoke(OAuthClient.java:160)
> 01-20 09:26:18.216: WARN/System.err(19409):     at
> org.ifies.brightroid.oauth.AndroidAccessor.postMessage
> (AndroidAccessor.java:76)
> 01-20 09:26:18.226: WARN/System.err(19409):     at
> org.ifies.brightroid.me.PostNote$2.run(PostNote.java:77)
> 01-20 09:26:18.226: WARN/System.err(19409):     at
> android.os.Handler.handleCallback(Handler.java:542)
> 01-20 09:26:18.236: WARN/System.err(19409):     at
> android.os.Handler.dispatchMessage(Handler.java:86)
> 01-20 09:26:18.236: WARN/System.err(19409):     at
> android.os.Looper.loop(Looper.java:123)
> 01-20 09:26:18.246: WARN/System.err(19409):     at
> android.app.ActivityThread.main(ActivityThread.java:3742)
> 01-20 09:26:18.246: WARN/System.err(19409):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 01-20 09:26:18.256: WARN/System.err(19409):     at
> java.lang.reflect.Method.invoke(Method.java:515)
> 01-20 09:26:18.256: WARN/System.err(19409):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:739)
> 01-20 09:26:18.266: WARN/System.err(19409):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
> 01-20 09:26:18.266: WARN/System.err(19409):     at
> dalvik.system.NativeStart.main(Native Method)
>
>
> The first one I have no idea why it's happening, but the second - I
> get a 201 created, which is a valid code - but the library still
> throws an exception. Does anyone have any ideas why it would do this,
> and how to handle it better?  Is it possibly a bug in the library and
> it's only expecting a 200??
>
> Any help would be appreciated.
>
> Regards,
> Tane
> >

--~--~---------~--~----~------------~-------~--~----~
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