DataSource Tries To Connect To Different DB Listen Port Then It Gets java.net.SocketTimeoutException: connect timed out

(Doc ID 2411439.1)

Last updated on JUNE 19, 2018

Applies to:

Oracle WebLogic Server - Version 12.1.3.0.0 and later
Information in this document applies to any platform.

Symptoms

A working server became intermittently unable to connect to its jdbc data sources.

For a Data Source configured to connect to Port 1521, it is seems that initially it tries to connect to 1521 and then it retries different port (1523) finally data source fails and connection is timed out.

Note that in this case port 1523 is blocked by firewall.

Following exception is reported in server logs:

java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:743)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:666)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:317)
at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:486)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:174)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:109)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection0(XAConnectionEnvFactory.java:548)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.access$000(XAConnectionEnvFactory.java:31)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory$1.run(XAConnectionEnvFactory.java:503)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection(XAConnectionEnvFactory.java:500)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.createResource(XAConnectionEnvFactory.java:201)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1331)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:425)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:344)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:497)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:425)
at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:133)
at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:83)
at weblogic.jdbc.jta.DataSource.getXAConnectionFromPool(DataSource.java:1834)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1590)
at weblogic.jdbc.jta.DataSource.getConnectionInternal(DataSource.java:517)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:494)
....
Caused By: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:470)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:506)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:595)
at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:220)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:264)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:666)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:317)
at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:486)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:174)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:109)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection0(XAConnectionEnvFactory.java:548)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.access$000(XAConnectionEnvFactory.java:31)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory$1.run(XAConnectionEnvFactory.java:503)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection(XAConnectionEnvFactory.java:500)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.createResource(XAConnectionEnvFactory.java:201)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1331)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:425)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:344)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:497)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:425)
at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:133)
at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:83)
at weblogic.jdbc.jta.DataSource.getXAConnectionFromPool(DataSource.java:1834)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1590)
at weblogic.jdbc.jta.DataSource.getConnectionInternal(DataSource.java:517)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:494)
at weblogic.jdbc.common.internal.RmiDataSource.getConnectionInternal(RmiDataSource.java:565)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:545)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:538)
....
Caused By: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:161)
at oracle.net.nt.ConnOption.connect(ConnOption.java:159)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:428)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:506)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:595)
at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:220)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:264)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:666)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:317)
at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:486)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:174)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:109)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection0(XAConnectionEnvFactory.java:548)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory.access$000(XAConnectionEnvFactory.java:31)
at weblogic.jdbc.common.internal.XAConnectionEnvFactory$1.run(XAConnectionEnvFactory.java:503)
...

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms