Io 异常: The Network Adapter could not establish the connection
新接触一个项目,导入源码,在本地启动的时候后台报了一个错误:
Could not discover the dialect to use. java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
at java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
at at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
at at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at at java.sql.DriverManager.getConnection(DriverManager.java:582)
at at java.sql.DriverManager.getConnection(DriverManager.java:185)
at at ch.qos.logback.core.db.DriverManagerConnectionSource.getConnection(DriverManagerConnectionSource.java:54)
at at ch.qos.logback.core.db.ConnectionSourceBase.discoverConnnectionProperties(ConnectionSourceBase.java:47)
at at ch.qos.logback.core.db.DriverManagerConnectionSource.start(DriverManagerConnectionSource.java:38)
at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:168)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:315)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:194)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:180)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:52)
at at ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:332)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:126)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:93)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:52)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:60)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:121)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
at at org.mule.context.DefaultMuleContextFactory.<clinit>(DefaultMuleContextFactory.java:36)
首先想到的是是不是数据配置有问题,找到配置数据库的文件,先检查服务器IP是否正确,ping一下服务器IP地址,看是否正确,在dos页面输入如下指令:
ping 服务器IP
得到的结果如下:

请求超时,意识到这可能是生产环境的数据,在本地启动没有操作权限,需要更改为测试环境的数据库启动。
如若没有找到问题所在,后续的分析方法:
1.判断端口号是否正确,在一般不会有错误,但可能使用多个oracle版本,导致端口号不为1521的情况。
进行一下操作:在DOS上键入sqlplus,检查oracle是否开启,若一切正常,问题仍没有解决,进行下一步。
2.检查目标机器是否装有防火墙,可能是服务器端口号屏蔽而造成的,关闭防火墙后,尝试重新连接。仍未解决,进行下一步。
3.检查数据库监听是否启动:下面以现在主流的数据库ORACLE为例:
重新手动启动数据库监听: 开始 → 运行→ 输入CMD→ 进入DOS命令提示界面 d:>lsnrctl LSNRCTL> status 或者 LSNRCTL> start
注:可能服务器上有多个监听,默认lsnrctl start启动的是 LISTENER这个监听, 查看其他监听可以搜索listener.ora这个文件。
看看是否有其他的监听,如果有,使用lsnrctl start 监听名字。
# listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools. SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME=RS)
(SID_NAME = RS)
(ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
) LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.12)(PORT = 1521))
)
) ADR_BASE_LISTENER = D:\app\Administrator
Io 异常: The Network Adapter could not establish the connection的更多相关文章
- 数据库连接报错之IO异常(The Network Adapter could not establish the connection)
Io 异常: The Network Adapter could not establish the connection 有以下四个原因: 1.oracle配置 listener.ora 和tnsn ...
- Io 异常: The Network Adapter could not establish the connection解决方案
Io 异常: The Network Adapter could not establish the connection解决方案 2016年06月04日 13:30:21 阅读数:46589 Io ...
- oracle:程序后台提示Io异常: The Network Adapter could not establish the connection)
今天要用tomcat部署一个系统,windows环境下,oracle和程序在一台机器上. 在配置jndi时,直接写成 jdbc:oracle:thin:@127.0.0.1:1521:orcl.启动程 ...
- Oracle连接报错之IO异常(The Network Adapter could not establish the connection)
简单介绍:自己封装oracle jdbc的一些常用功能jar包,自己本机玩没啥问题,给别人玩儿,发现总是抛异常 IO异常(The Network Adapter could not establish ...
- Io 异常: The Network Adapter could not establish the connection 解决方法
1.IP错误: 在设置URL时错误,例如:jdbc:oracle:thin:@192.168.1.80:1521:orcl 数据库服务器是否正确:ping 服务器IP是否通畅.ping不通则将URL更 ...
- [Oracle] Io Error: The Network Adapter could not establish the connection 解决方案
Io 异常: The Network Adapter could not establish the connection这个异常的出现一般与数据库和你的PC的设置有关 这种异常的出现大致上有下面几种 ...
- sqldeveloper建立新的连接是出现Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection解决办法: ...
- The Network Adapter could not establish the connection问题研究
最近一个项目会报上述错误,但也不是经常发生,所以很难跟踪,影响不是很大,但每次看到日志中这个错误就会不舒服,还是要想办法解决才是. 错误提示信息很明确是网络适配器不能创建连接. 查了很多资料,并且Or ...
- 数据库 The Network Adapter could not establish the connection解决方案
连接数据库 注意 url ip地址换的时候 oracle 里的listener.ora thnsnames.ora也要随之变化 重启数据库 不然可能会报出 java.sql.SQLException: ...
随机推荐
- 使用tail命令实时查看日志文件
[Shell] 纯文本查看 复制代码 ? 1 tail -f /日志文件 好了.就这样用.简单吧 退出ctrl+C
- C#访问C++动态分配的数组指针
项目中遇到C#调用C++算法库的情况,C++内部运算结果返回矩形坐标数组(事先长度未知且不可预计),下面方法适用于访问C++内部分配的任何结构体类型数组.当时想当然的用ref array[]传递参数, ...
- python 正则表达式之零宽断言
零宽断言:用于查找特定内容之前或之后的内容,但并不包括特定内容本身.对于零宽断言来说,我认为最重要的一个概念是位置,零宽断言用于指定一个位置,这个位置应该满足一定的条件(它附近满足什么表达式),并且这 ...
- kubernetes入门实践
k8s中文文档 k8s概念比较多,有什么概念的疑惑的推荐看k8s中文文档. me的环境 操作系统:centos7 docker:1.12.6 环境跟me的不一致?不要慌,基本大部分操作都是行的通的. ...
- selenium webdriver使用click一直失效问题的几种解决方法
想要爬取动态网页,很莫名的click失效.被这个问题困扰了很久,基本上把网上提到的所有方法试遍了,最终终于有个方法成功了,在这里总结一下. 这是我想要点击的网页,初始时实在0.5km上,它的class ...
- Java设计模式之策略设计模式
1.什么是-策略设计模式 在软件开发中常常遇到这种情况,实现某一个功能有多种算法或者策略,我们可以根据环境或者条件的不同选择不同的算法或者策略来完成该功能.如查找.排序等,一种常用的方法是硬编码(Ha ...
- HDU 1043 Eight (BFS·八数码·康托展开)
题意 输出八数码问题从给定状态到12345678x的路径 用康托展开将排列相应为整数 即这个排列在全部排列中的字典序 然后就是基础的BFS了 #include <bits/stdc++.h ...
- CEF中JavaScript与C++交互
在CEF里,JS和Native(C/C++)代码能够非常方便的交互,这里https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegr ...
- freemarker四种变量
freemarker四种变量 1.简单介绍说明 (1)数据模型中的变量:root中的变量 (2)模板中的变量:使用<#assign>定义的变量 (3)局部变量:在指令中的变量 (4)循环变 ...
- jmeter入门系列文章二 版本号介绍
转载时请标注源自:http://blog.csdn.net/musen518 jmeter版本号公布频率一般为1年,每年会有一个版本号升级 截止2015年底,最新版本号为2.13,最新最全的更新信息一 ...