【发布时间】:2020-03-18 11:56:19
【问题描述】:
我正在尝试使用 IntelliJ 运行我的 Spring Boot 应用程序,并且我正在使用 Oracle JDBC 我总是遇到这个错误:
java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
我认为这是一个依赖问题,我删除了所有 .m2 存储库并重新导入了项目,但我得到了同样的错误
这是我的 application.properties :
server:
port: 9000
spring:
profiles: dev
datasource:
url: jdbc:oracle:thin:@localhost:1521:xe
username: me
password: me
driver-class-name: oracle.jdbc.OracleDriver
jpa:
database-platform: org.hibernate.dialect.Oracle10gDialect
hibernate:
ddl-auto: update
show-sql: true
autoconfigure:
exclude: org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
data:
rest:
base-path: /api
liquibase:
enabled: false
change-log: classpath:db/changelog/changelog-master.yaml
这是我 pom.xml 中的 oracle 依赖项:
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency>
【问题讨论】:
-
将validationQuery="SELECT 1" 添加到您的数据资源
-
我添加了它,但我仍然得到同样的错误
标签: spring-boot maven intellij-idea