ojdbc6报红以及nested exception is org.hibernate.service.spi.ServiceException: 已解决

错误记录5:

报错如下:Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

报这个错误在网上搜了一堆 都没解决  最后发现是ojdbc6那个jar包的问题,这个包之前jar包加的时候就有问题  当时是报红 以为不报红就没事了 ,

接下来记录一下解决这个问题的方法

1.因为ojdbc6是收费的,不能像别的jar包一样在pom里复制代码自动下载,所以需要我们手动加  首先 下载一个ojdbc6的jar包

下载地址:https://download.csdn.net/download/ting0712/12064893

放在你的maven仓库里 

2.打开

 

扫描二维码关注公众号,回复: 11172405 查看本文章

这里选择的是 前面下的 那个jar包  

点完ok点 Apply--->再Ok 就可以了 

pom文件里的 关于ojdbc6的这段注释掉就可以了

<!-- https://mvnrepository.com/artifact/com.oracle.jdbc/ojdbc8 -->
    <!--<dependency>-->
      <!--<groupId>com.oracle</groupId>-->
      <!--<artifactId>ojdbc6</artifactId>-->
      <!--<version>11.2.0.2.0</version>-->
    <!--</dependency>-->

 我的这个错误是 这个jar包 加好了 就完事了  

为报这个错的同僚 提供一个 解决办法 over

原创文章 13 获赞 28 访问量 1791

猜你喜欢

转载自blog.csdn.net/ting0712/article/details/103763479