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
jdengjdeng 

query behind a proxy server gets error Connection timed out:could be due to invalid address

One of our end users is behind proxy server, and he can login to https://www.salesforce.com/api/u/9.0 using my application.  however, when he issues a query, my application returns the below error: 
 
nested exception is:

        java.net.SocketException: Connection timed out:could be due to invalid address

 

 

I set up my proxy settings using System.setproperties("http.proxyHost", proxyServerName);

System.setproperties("http.proxyPort", proxyportnumber);

I'm suspecting the issue is at queryresult or querymore, since his data is larger than 2000 records.  Is there anything else that I need to setup for binding behind proxy?(or webservice calls in general behind proxy server?)

and my application is using axis 1.4, commons-http-client3.1 and API 9.0

 

Rick.BanisterRick.Banister
There are known bugs in commons-httpclient-3.0-rc2.jar and commons-httpclient-3.0-rc3.jar. You should be using commons-httpclient-3.0-rc4.jar. The symptom was that you can't even connect behind a firewall with the buggy releases.
jdengjdeng
Thanks Rick for the reply, however, I don't think that is my issue.  I'm using commons-httpclient-3.1.jar, the latest release; and user was able to login behind proxy, but getting this error in doing query
jdengjdeng
It seems the user account is limited to a single connection, my application tries to esablish 3 simutanenous connections, and that's why I'm getting the invalid address error.  Now, I changed to single connection, I'm getting the java.net.SocketTimeoutException: Read timed out
 
Anyone has idea of what this is? is this related to the binding.setTimeout()?  My enduser has large trunk of data, and my application right now sets the binding timeout to be 90seconds.
Rick.BanisterRick.Banister
  • Yes, the API limits you to 1 connection. We've used up to 5 connections in separate jobs concurrently; that is the maximum for any customer.
  • How many records are you trying to query?
  • Does this work outside of a firewall?
  • Is this Java or what other language?

Suggest you contact me directly at (831) 234-0754 or shoot me an email. I've solved this but we'll spend a week back and forth with postings at this rate.