数据源连接异常 IO 错误: The Network Adapter could not establish the connection
在 mac 上配置 oracle 的 url, 下载相同的 jar 放到 common/jdbc 中心,然后从官网下载 windows 版,使用相同的配置和 jar,连接报错 IO 错误: The Network Adapter could not establish the connection
SEVERE: java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection
java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:902)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:813)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:80)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:816)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:620)
at com.scudata.common.DBSessionFactory.getSession(DBSessionFactory.java:43)
at com.scudata.ide.common.DataSource.getDBSession(DataSource.java:213)
at com.scudata.ide.common.dialog.DialogDataSource.jBConnect_actionPerformed(DialogDataSource.java:299)
at com.scudata.ide.common.dialog.DialogDataSource_jBConnect_actionAdapter.actionPerformed(DialogDataSource.java:502)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at org.pushingpixels.substance.internal.utils.RolloverButtonListener.mouseReleased(RolloverButtonListener.java:124)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
at java.awt.Dialog.show(Dialog.java:1084)
at java.awt.Component.show(Component.java:1671)
at java.awt.Component.setVisible(Component.java:1623)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1005)
at com.scudata.ide.spl.GMSpl.executeCmd(GMSpl.java:110)
at com.scudata.ide.common.AppMenu.executeCmd(AppMenu.java:821)
at com.scudata.ide.common.AppMenu$1.actionPerformed(AppMenu.java:809)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:720)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:586)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:729)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:340)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1701)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:626)
… 94 more
Caused by: java.io.IOException: Socket read timed out, socket connect lapse 10015 ms. /10.249.240.19 1521 10000 1 true
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:252)
at oracle.net.nt.ConnOption.connect(ConnOption.java:195)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:653)
… 99 more
Caused by: oracle.net.nt.TimeoutInterruptHandler$IOReadTimeoutException: Socket read timed out
at oracle.net.nt.TimeoutSocketChannel.handleInterrupt(TimeoutSocketChannel.java:265)
at oracle.net.nt.TimeoutSocketChannel.connect(TimeoutSocketChannel.java:113)
at oracle.net.nt.TimeoutSocketChannel.(TimeoutSocketChannel.java:95)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:211)
… 101 more
看下数据源是怎么配置的,尤其是 ip 那块,这个错误一般情况下是网络连接问题,确保网络能互通,可以 ping 下看看
部署计算器的服务器已经测试过,ping 数据库地址,可以接收到,所以这种可能可以排除
没看懂,是在 mac 使用官网上下载的驱动连接 oracle?
连接错误可以参考:https://blog.csdn.net/qq_42557844/article/details/103940544
mac 上连接数据源没问题。我在 windows 上碰到了问题,数据源是 oracle,ping oracle 地址是可以接收数据的,但是在 spl 配置连接的时候,异常
windows 需要安装 oracle 客户端吗
oci 需要安装客户端,thin 不需要。
ping 得通,只能证明和 oracle 所在机器是通的,不能证明有没有防火墙及 oracle 配置正确
解决了,感谢,因为那台部署 spl 的服务器连接数据库服务器是不同的,需要开通端口