[英]Springboot+JPA(Hibernate)+Oracle AbstractMethodError not define or inherit an implementation of isValid(int)
I'm a beginner in using Spring boot, and when I tried running the demo program, it reported exceptions as such:我是使用 Spring boot 的初学者,当我尝试运行演示程序时,它报告了如下异常:
Caused by: java.lang.AbstractMethodError: Receiver class oracle.jdbc.driver.T4CConnection does not define or inherit an implementation of the resolved method 'abstract boolean isValid(int)' of interface java.sql.Connection.
I've tried many solutions on the web (like upgrade the driver to ojdbc7 or higher, while I've been using ojdbc8 from the begining, and even tried ojdbc8 and ojdbc10 downloading from the website of Oracle 19c, but no one worked).我在网上尝试了很多解决方案(例如将驱动程序升级到 ojdbc7 或更高版本,而我从一开始就使用 ojdbc8,甚至尝试从 Oracle 19c 网站下载 ojdbc8 和 ojdbc10,但都没有成功)。
Following @JensSchauder 's suggestions, I peeked into the class oracle.jdbc.driver.T4CConnection
and found there was really no such method called boolean isValid(int)
but boolean isValidLight(int)
instead.按照@JensSchauder 的建议,我查看了
oracle.jdbc.driver.T4CConnection
类,发现确实没有这样的方法叫做boolean isValid(int)
而是boolean isValidLight(int)
。
Here is the screenshoot:这是屏幕截图:
ScreenShoot Here, boolean isValidLight(int var1) ScreenShoot Here, boolean isValidLight(int var1)
Here list the ojdbcs I've tried:这里列出了我尝试过的 ojdbcs:
How should I suppose to fix this?我应该如何解决这个问题? Maybe give up Oracle?
也许放弃甲骨文?
Thanks for all your tips.感谢您的所有提示。
Something is really fishy here.这里的东西真的很可疑。 The method Hikari is looking for was introduced in Java 1.6 so it should definitely be there with
ojdbc8
. Hikari 正在寻找的方法是在 Java 1.6 中引入的,因此它绝对应该与
ojdbc8
一起ojdbc8
。
I'd try the following to better understand what is going on.我会尝试以下操作以更好地了解发生了什么。
Connection
class in the IDE and inspect it if it has the isValid
method or not.Connection
类并检查它是否具有isValid
方法。 I strongly suspect it has. This already might give enough hints to debug this, if not please update your questions with the information you found.这可能已经为调试提供了足够的提示,如果没有,请使用您找到的信息更新您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.