function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NovelBeeNovelBee 

Eclipse SFDC connection issue

Hi All,

I am trying to load photos into the chatter for around 1000 users. I am using code I found on github. (https://github.com/felixrivas/ChatterUtility). When I run the program, I get the following error

org.apache.http.conn.HttpHostConnectException: Connection to https://test.salesforce.com refused

      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)

      at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)

      at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)

      at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)

      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)

      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)

      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)

      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)

      at com.salesforce.chatter.provisioner.rest.ChatterRESTOAuthTokenStore.authenticate(ChatterRESTOAuthTokenStore.java:123)

      at com.salesforce.chatter.provisioner.rest.ChatterRESTOAuthTokenStore.initialize(ChatterRESTOAuthTokenStore.java:74)

      at com.salesforce.chatter.provisioner.rest.ChatterRESTOAuthTokenStore.getChatterRestAccessToken(ChatterRESTOAuthTokenStore.java:86)

      at com.salesforce.chatter.provisioner.rest.ChatterRESTOAuthTokenStore.getAccessToken(ChatterRESTOAuthTokenStore.java:96)

      at com.salesforce.chatter.provisioner.rest.ChatterRESTWrapper.performRESTQuery(ChatterRESTWrapper.java:609)

      at com.salesforce.chatter.provisioner.rest.ChatterRESTWrapper.retrieveUserIdFromFilenames(ChatterRESTWrapper.java:181)

      at com.salesforce.chatter.provisioner.rest.ChatterRESTWrapper.processFileUpload(ChatterRESTWrapper.java:89)

      at com.salesforce.chatter.provisioner.ChatterProvisioner.executeUserFileUploadProvisioner(ChatterProvisioner.java:114)

      at com.salesforce.chatter.provisioner.ChatterProvisioner.main(ChatterProvisioner.java:56)

Caused by: java.net.ConnectException: Connection refused: connect

      at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)

      at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)

      at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)

      at java.net.AbstractPlainSocketImpl.connect(Unknown Source)

      at java.net.PlainSocketImpl.connect(Unknown Source)

      at java.net.SocksSocketImpl.connect(Unknown Source)

      at java.net.Socket.connect(Unknown Source)

      at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)

      at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:375)

      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)

      ... 16 more

 

I have tried setting the System properties in main but still the code does not work. Can someone please tell me how do I make a connection from Eclipse to access my sandbox.

Vinita_SFDCVinita_SFDC

Hello,

 

Please refer the following link:

http://shivasoft.in/blog/salesforce/install-force-com-ide-in-eclipse-salesforce-com/

While creating new project you will be asked for username password and security token, here enter login credentials of your sandbox and securty token generated by your sandbox. Once this is done try executing you code.

If you have already done this and still facing this issue then please check following:

1. You don't have the internet connection properly installed (means no internet connectivity) or,
2. The calling program needs to point to the current proxy you have set.So for Internet connection you have to provide proxy information.

 

Referred:
http://boards.developerforce.com/t5/Java-Development/connect-to-salesforce-through-post/td-p/632095
http://boards.developerforce.com/t5/Java-Development/how-to-deal-with-connectException-connection-refused/td-p/42336
http://www.forumtopics.com/busobj/viewtopic.php?p=729612

Rahul_sgRahul_sg
Hi Vinita,

Thanks for your reply.
We are able to run this application from outside n/w.
however from our office intranet we are receiving this error.

I also tried adding

System.setProperty(
"http.proxyHost", "");
System.setProperty(
"http.proxyPort", "");

In the main method to set proxy detail, but it didn't work.

Any suggestions?

Vinita_SFDCVinita_SFDC

Hello Rahul,

 

Please make sure that you set the value of proxyHost and proxyPort in the main loop of your code. Example:

 

System.setProperty("proxyHost", "yourproxy.server.com");
        System.setProperty("proxyPort", "8080");

Vedika GhaiVedika Ghai
Hi,
I did set the value of proxy in main loop.I am still getting the connection timed out error.