If you are getting java.net.socketexception 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.
** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection timed out STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection timed out at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:150) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:270) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2635) at com.mysql.jdbc.Connection.<init>(Connection.java:1525) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:260) at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:316) at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:217) at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1109) at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1033) at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:214) at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1051)
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 abc.domainserv.com 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.