2

commons-codec-1.3 jar linkin-j signpost-core-1.2.1.1 の jar を使用しています

LinkedIn API 用。Windowsサーバーで正常に動作しています。ubuntuにも同じコードがありますが、次のようなエラーが発生しました

oAuthService=LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(key, secret);
        request=oAuthService.getOAuthRequestToken("http://www.google.com");

getOAuthRequestToken でエラーが発生しました

Exception in thread "main" com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 400 for URL: https://api.linkedin.com/uas/oauth/requestToken
    at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:180)
    at com.cpt.linkedin.linkedINExample.authorize(linkedINExample.java:57)
    at com.cpt.linkedin.linkedINExample.main(linkedINExample.java:38)
Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 400 for URL: https://api.linkedin.com/uas/oauth/requestToken
    at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
    at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
    at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:172)
    ... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.linkedin.com/uas/oauth/requestToken
    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:532)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1458)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1452)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1106)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    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)
    ... 4 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.linkedin.com/uas/oauth/requestToken
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1403)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:397)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getStatusCode(HttpURLConnectionResponseAdapter.java:22)
    at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:178)
    ... 4 more
4

1 に答える 1