connection timed out

Java Errors

If you are getting connection timed out error in your log file. then there are few things which can be verified to nail down the issue.

Usually this error comes when there is  a connectivity issue. We receive this error when a thread tries to open a socket to some port number to get connection but could not able to connect.


MESSAGE: Connection timed out

STACKTRACE: Connection timed out
at com.mysql.jdbc.StandardSocketFactory.connect(
at com.mysql.jdbc.MysqlIO.<init>(
at com.mysql.jdbc.Connection.createNewIO(
at com.mysql.jdbc.Connection.<init>(
at com.mysql.jdbc.NonRegisteringDriver.connect(
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(
at weblogic.common.resourcepool.ResourcePoolImpl.start(
at weblogic.jdbc.common.internal.ConnectionPool.doStart(


First, check the datasource used to connect to DB.

Is the host pingabel from the server machine where this error occurs. If yes then go to next step

telnet to the port its trying to connect like telnet hostname portnumber

telnet 1521

If telnet becomes successful then see the JNDI url provided to connect is correct or not.

If above are successful then make sure you dont have any network latency over there. you can restart network services if you find some latency to reset.

If all above is working then login to the host you want to connect and check the port is ready to accept connection or not by doing a netstat -an | find “portnumber” or netstat -an | grep “portnumber” it should be in LISTENING state. Incase it’s not in listening state restart the service to reset. If still you are not able to fix this then make sure Firewall on from host and To host both are allowing connections. Make sure you dont have any rules etup in firewall which blocks incoming connections to the host or outgoing connections to host.

If from above also this does not fix or you dont find root cause then make sure the port you are trying to connect is not listening to localhost only disallowing other connections and check what is the maximum incoming connection limit for the port.

If all above fails to find root cause then try to restart both services and try a fresh connect else check incase recently some security patch which gone into OS which is blocking incoming or outgoing connections.

Check whether your network is reached its maximum connections limit.

Usually by trying above you will get the root cause.

There is another good resource on stackoverflow on getting the tcpdump to analyse it more.


In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply