+ Start a Discussion
Naresh.TNaresh.T 

Getting Java.net.ConnectException:connection timed out Exception

Hi,

I am trying to login to salesforce using api's.I am new to the salesforce.I am trying the sample code given in apex api doc.I am getting java.net.ConnectException.

I am using JDK 5.0 ,axis 1.4,apex api's 9.0 and tomcat 5.5.20

The stack trace is given below. Please help me to fix this.

 

An unexpected error has occurred: ; nested exception is: 
 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: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:2595)
 at org.honeywell.Samples.login(Samples.java:81)
 at org.honeywell.Samples.run(Samples.java:325)
 at org.honeywell.Samples.main(Samples.java:36)

 {http://xml.apache.org/axis/}hostname:IE10DTJ8FNM1S

java.net.ConnectException: Connection timed out: connect
 at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
 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:2595)
 at org.honeywell.Samples.login(Samples.java:81)
 at org.honeywell.Samples.run(Samples.java:325)
 at org.honeywell.Samples.main(Samples.java:36)
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: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)
 ... 13 more


 Thanks,

Naresh.T

SuperfellSuperfell
You probably have a firewall that's blocking access, or need to access via a proxy server.
Naresh.TNaresh.T
Hi Simon,
 
I have configured the proxy server by using the following lines in the code
I used host name as the ip of my organization's proxy server and port number as 8080. Now I am getting the

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection.

Is anything wrong in configuring the proxy server.please help me in fixing the error.

Thanks,

Naresh.T

Code:
 System.setProperty("https.proxyHost", "hostname");
 System.setProperty("https.proxyPort", "port number");

 
 
kamalkamal
Hi i m getting the same exception as you got

An unexpected error has occurred: ; nested exception is: 
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: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.&lt;init&gt;(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:2595)
at org.honeywell.Samples.login(Samples.java:81)
at org.honeywell.Samples.run(Samples.java:325)
at org.honeywell.Samples.main(Samples.java:36)

{http://xml.apache.org/axis/}hostname:IE10DTJ8FNM1S

java.net.ConnectException: Connection timed out: connect
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
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:2595)
at org.honeywell.Samples.login(Samples.java:81)
at org.honeywell.Samples.run(Samples.java:325)
at org.honeywell.Samples.main(Samples.java:36)
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: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)
... 13 more
will you please help

Thanks in advance
Naresh.TNaresh.T
You are behind the firewall. set the proxy settings in the code and try
RNeigenfindRNeigenfind

Error message: "Exception class org.apache.axis.AxisFault is caught with message=; nested exception is: java.net.ConnectException: Connection timed out. "

 

Double Check Firewall, proxy and antivirus, Try another desktop, but still having problems.

 

Using "Informatica Cloud" Conection to import products.

 

Any suggestions? Could be a "Informatica Cloud" bug?

 

Thanks a lot,

Rneigenfind

planetsaroplanetsaro

Naresh, did you figure out the solution for this? I am getting the same exception after the proxy settings.