A problem with Request.java in Oauth library

日期:2011-06-30    阅读:25   分类:综合信息


今天在使用 Oauth library的时候发现了个bug,就给作者发了个邮件,目前我的做法是先修改了源码编译个jar包使用,等待着作者的修复。

邮件内容贴在这里,做记录:

Firstly, thanks for the Oauth library you developed, it's saved my time to do the authentication.
Now I found a problem when I am trying to set the Connection Timeout and Read Timeout to HTTPURLConnection, Please see the following code:
OAuthRequest request = new OAuthRequest(Verb.GET, URL);
scribe.signRequest(accessToken, request);
request.setReadTimeout(Processor.READ_TIMEOUT, TimeUnit.SECONDS);
request.setConnectTimeout(Processor.CONNECTION_TIMEOUT, TimeUnit.SECONDS);
Response response = request.send();
When I ran the above code then the system will throw an exception as the following:
java.lang.NullPointerException
at org.scribe.model.Request.setReadTimeout(Request.java:293)
at com.vsp.uupis.processor.TwitterProcessor.getDataByFixedIdentifer(TwitterProcessor.java:113)
at com.vsp.uupis.Processor.processPersons(Processor.java:163)
at com.vsp.uupis.Processor.batchExecute(Processor.java:129)
at com.vsp.uupis.processor.TwitterProcessor.runFixedIdentifer(TwitterProcessor.java:69)
at com.vsp.uupis.processor.TwitterProcessor.run(TwitterProcessor.java:87)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

I have used the version 1.2.1, please feel free to take a look for this question, thanks very much.

本页链接: http://www.scriptlover.com/static/714-oauth-java

标签:

相关文章

网友评论

#1: 2011-9-27 19:03:00 by Gabbyxiaoxiongguigui#sina.com

was totally stuck until i read this, now back up and rnuinng.

#2: 2011-9-29 7:22:00 by Evalineinfo#grotonwellness.com

yeah, that's the tciekt, sir or ma'am

Leave a comment

 required

 required (Not published)

 required