新接触一个项目,导入源码,在本地启动的时候后台报了一个错误:

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的更多相关文章

  1. 数据库连接报错之IO异常(The Network Adapter could not establish the connection)

    Io 异常: The Network Adapter could not establish the connection 有以下四个原因: 1.oracle配置 listener.ora 和tnsn ...

  2. 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 ...

  3. oracle:程序后台提示Io异常: The Network Adapter could not establish the connection)

    今天要用tomcat部署一个系统,windows环境下,oracle和程序在一台机器上. 在配置jndi时,直接写成 jdbc:oracle:thin:@127.0.0.1:1521:orcl.启动程 ...

  4. Oracle连接报错之IO异常(The Network Adapter could not establish the connection)

    简单介绍:自己封装oracle jdbc的一些常用功能jar包,自己本机玩没啥问题,给别人玩儿,发现总是抛异常 IO异常(The Network Adapter could not establish ...

  5. 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更 ...

  6. [Oracle] Io Error: The Network Adapter could not establish the connection 解决方案

    Io 异常: The Network Adapter could not establish the connection这个异常的出现一般与数据库和你的PC的设置有关 这种异常的出现大致上有下面几种 ...

  7. 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解决办法: ...

  8. The Network Adapter could not establish the connection问题研究

    最近一个项目会报上述错误,但也不是经常发生,所以很难跟踪,影响不是很大,但每次看到日志中这个错误就会不舒服,还是要想办法解决才是. 错误提示信息很明确是网络适配器不能创建连接. 查了很多资料,并且Or ...

  9. 数据库 The Network Adapter could not establish the connection解决方案

    连接数据库 注意 url ip地址换的时候 oracle 里的listener.ora thnsnames.ora也要随之变化 重启数据库 不然可能会报出 java.sql.SQLException: ...

随机推荐

  1. mssql执行计划查看的一些知识

    在MSSQL中,查看较慢语句的执行计划,就是一个比较直观的方式, 如果查看执行计划呢: 1.从右到左,从上到下的顺序阅读执行计划2.执行计划中每个图标代表一个运算符,总开销为100%3.数据从右向左在 ...

  2. Java开发小技巧(一)

    前言 相信许多程序员在看别人写的代码的时候,会有怀疑人生的感想,面对一堆天书一样的代码,很难摸清作者的思路,最后选择了重构,如果你认同上面这个作法,说明了两个问题:要么原来的开发者技术菜.要么你技术菜 ...

  3. Python笔记·第六章——字典 (dict) 的增删改查及其他方法

    字典是python中唯一的映射类型,采用键值对(key-value)的形式存储数据.python对key进行哈希函数运算,根据计算的结果决定value的存储地址,所以字典是无序存储的,且key必须是可 ...

  4. jdk7jdk8新特性概述

    在oracle停止对jdk6更新,jdk8发布之后,公司终于要把生产环境更新到jdk7,下面列一下jdk7,8的可能需要关注的新特性. jdk7 G1垃圾回收 fork-join框架 二进制变量 Sw ...

  5. javaweb学习总结(五)——Servlet开发(一)(转)

    转载自 http://www.cnblogs.com/xdp-gacl/p/3760336.html 一.Servlet简介 Servlet是sun公司提供的一门用于开发动态web资源的技术. Sun ...

  6. 独立安装WAMP

    安装apache 获得apache安装软件: 建议去官网下载: www.apache.org 双击执行: 进入欢迎界面 点击"next"进入到协议界面 接收协议点击"ne ...

  7. vector删除元素与清除内存空洞

    问题:stl中的vector容器经常造成删除假象,这对于c++程序猿来说是极其讨厌的,<effective stl>大师已经将之列为第17条,使用交换技巧来修整过剩容量. 内存空洞这个名词 ...

  8. JAVA入门[21]-Jedis操作redis示例

    本节目标 通过JedisPool获取Jedis示例,并完成对redis 简单的Key-value读写操作. 完整代码结构如下: redis服务端 在本地运行redis-server.exe,然后在re ...

  9. 腾讯云安全:移动 APP 安全行业报告

    移动 APP 已逐步渗透入我们的生活,据统计,2016年,APP 发行数量仅电商.金融.游戏这三大类共计高达2万左右,国内移动互联网活跃用户数已经突破10亿,移动互联网这样快速的推移,移动互联网的安全 ...

  10. Linux小记 — Ubuntu自动化配置

    前言 工欲善其事,必先利其器.经过多次的重复配置ubuntu开发坏境,我终于决定花点时间总结一下,并将其写成一个自动化配置脚本.服务器实例:ubuntu 16.04,技术栈:shell,python. ...