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
iqbaliqbal 

Connection timeout exception

Hi all,
 
I am writing a Java program that will fetch the records from SFDC and insert them to Oracle database tables.My program is fetching records in batches of 250 each and then processing them.But at times i get an error message as:

Error occured; nested exception is:

      java.net.ConnectException: Connection timed out: connect

Error occured:java.net.ConnectException: Connection timed out: connect

AxisFault

 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException

 faultSubcode:

 faultString: java.net.ConnectException: Connection timed out: connect

 faultActor:

 faultNode:

 faultDetail:

      {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection timed out: connect

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

      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)

      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)

      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)

      at java.net.Socket.connect(Socket.java:452)

 

 

Please help me to find a solution for this problem

 

 
 
 
Thanks & Regards,
VN
NaishadhNaishadh
 It might be due to your session may be experied.

Just increase your session timeout period and it will work.
anthony.rajanthony.raj

Hi,

Im having the same problem when i try to connect to salesforce using java

Exception is as follows :

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.net.ConnectException: Connection timed out: connect
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace: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:364)
        at java.net.Socket.connect(Socket.java:507)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:546)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:349)
        at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:69)
        at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
        at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
        at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at com.sforce.soap.enterprise.SoapBindingStub.login(SoapBindingStub.java:2412)
        at connection.Main.login(Main.java:72)
        at connection.Main.<init>(Main.java:40)
        at connection.Main.main(Main.java:104)

I have tried increasing the time-out

below is the code snippet:
 
       String user = "***"; 
       String password = "****";
        try {
            SoapBindingStub binding = (SoapBindingStub)new SforceServiceLocator().getSoap();
            binding.setTimeout(1000000);
            LoginResult loginResult = binding.login(user, password);
        } catch(ServiceException se) {
            System.out.println("Unable to initalize Stub...");
            se.printStackTrace();
        } catch (RemoteException re) {
            System.out.println("Unable to Login...");
            re.printStackTrace();
        }
 
Thanks