alfdev / linkedin-j

Automatically exported from code.google.com/p/linkedin-j
0 stars 0 forks source link

Getting Connection timed out: connect #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Downloaded the latest source files.
2. Compiled the sources using eclipse.
3. Ran the OAuthAuthenticationExample as a java application specifying my 
consumer key and secret.

What is the expected output? What do you see instead?
Example should work as expected.But i get the following exception.

Fetching request token from LinkedIn...
com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: 
oauth.signpost.exception.OAuthCommunicationException: Communication with the 
service provider failed: Connection timed out: connect
    at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:140)
    at com.google.code.linkedinapi.client.examples.OAuthAuthenticationExample.processCommandLine(OAuthAuthenticationExample.java:76)
    at com.google.code.linkedinapi.client.examples.OAuthAuthenticationExample.main(OAuthAuthenticationExample.java:54)
Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication 
with the service provider failed: Connection timed out: connect
    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:129)
    ... 2 more
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
    at oauth.signpost.basic.DefaultOAuthProvider.sendRequest(DefaultOAuthProvider.java:48)
    at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:177)
    ... 4 more

What version of the product are you using? On what operating system?
I downloaded the following zip "linkedin-j-0.1-rc4.zip" and using it on windows 
XP.

Any help would be much appreciated.

Thanking you,

Vinay 

Original issue reported on code.google.com by kkvinay1...@gmail.com on 23 Jun 2010 at 3:48

GoogleCodeExporter commented 9 years ago
Made some progress on this issue, the proxy setting was causing the issue, made 
changes to include "https.proxyHost" and "https.proxyPort" now the example is 
able to go further but still throwing exceptions as below

Fetching request token from LinkedIn...
Request token: 69ae115e-0da9-4b00-bd8d-79e9a11c9da0
Token secret: af7b3b0d-749e-4f5e-b6d4-a16864c059eb
Expiration time: Wed Jun 23 09:33:07 IST 2010
Now visit:
https://www.linkedin.com/uas/oauth/authorize?oauth_token=69ae115e-0da9-4b00-bd8d
-79e9a11c9da0
... and grant this app authorization
Enter the PIN code and hit ENTER when you're done:
<Entered the pin obtained>
Fetching access token from LinkedIn...
Access token: 470dbafc-eecd-4ae5-aef2-543cd9ee974e
Token secret: 38fef827-669d-48d5-9c5a-f42c0c2b6871
Fetching profile for current user.
com.google.code.linkedinapi.client.LinkedInApiClientException: 
java.net.ConnectException: Connection timed out: connect
    at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.callApiMethod(BaseLinkedInApiClient.java:1251)
    at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.callApiMethod(BaseLinkedInApiClient.java:1189)
    at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.getProfileForCurrentUser(BaseLinkedInApiClient.java:789)
    at com.google.code.linkedinapi.client.examples.OAuthAuthenticationExample.processCommandLine(OAuthAuthenticationExample.java:108)
    at com.google.code.linkedinapi.client.examples.OAuthAuthenticationExample.main(OAuthAuthenticationExample.java:60)
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at java.net.Socket.connect(Socket.java:475)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
    at sun.net.www.http.HttpClient.New(HttpClient.java:323)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
    at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.callApiMethod(BaseLinkedInApiClient.java:1238)
    ... 4 more

Original comment by kkvinay1...@gmail.com on 23 Jun 2010 at 4:38

GoogleCodeExporter commented 9 years ago
Hi Vinay.
You will also have to include "http.proxyHost" and "http.proxyPort" (note http 
instead of https). This is because while authentication uses https , other apis 
use http. Let me know if you still run into issues.

Regards
Nabeel Mukhtar

Original comment by nabeelmukhtar on 24 Jun 2010 at 6:08

GoogleCodeExporter commented 9 years ago
Hi Nabeel,

Thank you very much that solved my problem.

Regards

-Vinay

Original comment by kkvinay1...@gmail.com on 24 Jun 2010 at 6:12

GoogleCodeExporter commented 9 years ago

Original comment by nabeelmukhtar on 24 Jun 2010 at 3:00