本文主要是介绍[报错解决]Failed to load driver class oracle.jdbc.OracleDriver,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
目录
- 报错信息
- 解决
报错信息
// 关键报错信息
java.lang.IllegalStateException: Failed to load ApplicationContextCaused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.boot.context.properties.bind.JavaBeanBinder$BeanProperty.setValue(JavaBeanBinder.java:348)... 99 more
Caused by: java.lang.RuntimeException: Failed to load driver class oracle.jdbc.OracleDriver in either of HikariConfig class loader or Thread context classloaderat com.zaxxer.hikari.HikariConfig.setDriverClassName(HikariConfig.java:486)... 104 more
解决
<!--测试Spring整合mybatis 配置多数据源 没有引入oracle驱动依赖包,导致测试报错-->
<!--引入oracle驱动包即可-->
<!-- oracle驱动 -->
<dependency><groupId>com.oracle.database.jdbc</groupId><artifactId>ojdbc8</artifactId><version>${oracle.version}</version>
</dependency>
这篇关于[报错解决]Failed to load driver class oracle.jdbc.OracleDriver的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!