"oracle.net.ns.NetException: The Network Adapter could not establish the connection" in JBoss EAP/Fuse
Issue
-
Oracle connection failure when running an application in JBoss EAP:
... WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (<THREAD-ID>) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:331) at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:288) at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:834) at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:379) at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:406) at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:378) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:354) at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:491) at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:143) ... Caused by: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458) [ojdbc6.jar:11.2.0.3.0] ... Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:392) [ojdbc6.jar:11.2.0.3.0] at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:434) [ojdbc6.jar:11.2.0.3.0] at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:687) [ojdbc6.jar:11.2.0.3.0] at oracle.net.ns.NSProtocol.connect(NSProtocol.java:247) [ojdbc6.jar:11.2.0.3.0] ... Caused by: java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) [rt.jar:1.7.0_75] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) [rt.jar:1.7.0_75] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) [rt.jar:1.7.0_75] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) [rt.jar:1.7.0_75] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) [rt.jar:1.7.0_75] at java.net.Socket.connect(Socket.java:579) [rt.jar:1.7.0_75] at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:150) [ojdbc6.jar:11.2.0.3.0] at oracle.net.nt.ConnOption.connect(ConnOption.java:133) [ojdbc6.jar:11.2.0.3.0] at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:370) [ojdbc6.jar:11.2.0.3.0] ... 67 more
-
Using JDK 8 and encountering a stack similar to the above but with a slightly different low level error
... Caused by: java.net.ConnectException: Connection timed out (Connection timed out) at java.net.PlainSocketImpl.socketConnect(Native Method) [rt.jar:1.8.0_152] 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:150) ...
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7
- 6
- Oracle
- Red Hat Fuse
- 7.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.