2011-12-19 179 views
3

我使用了這個問題的答案Posting LinkedIn message from Android application 試圖整合LinkedIn,但在設備不工作時該給定的例子LITest的Android LinkedIn集成錯誤表明我的一些錯誤,如下面在設備和仿真器

12-19 19:36:30.489: ERROR/AndroidRuntime(11868): FATAL EXCEPTION: main 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868): java.lang.RuntimeException: Unable to start activity ComponentInfo{pl.osadkowski.LITest/pl.osadkowski.LITest.LITestActivity}: com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: https://api.linkedin.com/uas/oauth/requestToken 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.app.ActivityThread.access$2300(ActivityThread.java:126) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.os.Handler.dispatchMessage(Handler.java:99) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.os.Looper.loop(Looper.java:123) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.app.ActivityThread.main(ActivityThread.java:4633) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at java.lang.reflect.Method.invokeNative(Native Method) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at java.lang.reflect.Method.invoke(Method.java:521) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at dalvik.system.NativeStart.main(Native Method) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868): Caused by: com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: https://api.linkedin.com/uas/oauth/requestToken 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:180) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at pl.osadkowski.LITest.LITestActivity.onCreate(LITestActivity.java:49) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  ... 11 more 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868): Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: https://api.linkedin.com/uas/oauth/requestToken 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:172) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  ... 14 more 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868): Caused by: java.io.FileNotFoundException: https://api.linkedin.com/uas/oauth/requestToken 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:253) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnectionResponseAdapter.java:18) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:228) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:189) 
12-19 19:36:30.489: ERROR/AndroidRuntime(11868):  ... 16 more 

當我運行它在模擬器上會問我授權的應用程序,我已授予應用程序。 之後,我不會被重定向到應用程序。請看下面的圖片。

enter image description here

+0

linkedin-j停止工作... https://api.linkedin.com/uas/oauth/requestToken ... 404 – Selvin 2011-12-19 14:22:46

+0

對不起,但linkedin-j停止工作意味着.... :( – 2011-12-19 14:27:02

+0

現在它工作...你是否改變了API密鑰? – Selvin 2011-12-19 14:42:09

回答

-1

的第一次嘗試,清除cookies,您初始化LinkedIn相關對象之前...使用下面的代碼

CookieSyncManager.createInstance(this); 

CookieManager cookieManager = CookieManager.getInstance(); 
cookieManager.removeAllCookie(); 

請更新我,如果它的工作原理或不....

+0

不工作.. – 2012-06-30 12:16:41

+0

你好RadheMohan,請給我提供一些你面臨的錯誤......還要檢查設備中的時間是否正確。 – 2012-07-04 05:56:16

+0

大家好,我想在這裏添加,鏈接-j api是無法獲得authFinish在Android 4.0及以上.. 任何更新的api – 2013-03-20 14:22:43

3

解決爲我..在設備和模擬器。

如果有任何錯誤或者即使1分鐘差異會給出此例外,時間,日期和時區應該是正確的。

相關問題