[英]Maven compilation and run time error java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z on Tomcat 8 Server
I've been converting a large Java Web App to a maven project, but I've run into an error in a handful of classes originating from the tomcat-dbcp jar. 我一直在将大型Java Web App转换为maven项目,但是在少数来自tomcat-dbcp jar的类中遇到了错误。 I get the following error messages from any class that needs to use BasicDataSource objects:
我从需要使用BasicDataSource对象的任何类中获得以下错误消息:
javax.servlet.ServletException: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
Now I know this jar is present on the server (as it is default in our Tomcat8 installation). 现在,我知道该jar存在于服务器上(因为它是我们Tomcat8安装中的默认值)。 So in maven I declared this dependency as such:
所以在Maven中我这样声明了这种依赖关系:
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>8.0.26</version>
<scope>provided</scope>
</dependency>
But I'm still seeing this error. 但是我仍然看到此错误。 What can I do to eliminate this error?
我该怎么做才能消除此错误?
This error did go away, though I have no idea why. 这个错误确实消失了,尽管我不知道为什么。 The pom entry is still the same and still running on Tomcat 8. We did find a hacky temporary fix:
pom条目仍然相同,并且仍在Tomcat 8上运行。我们确实找到了一个hacky临时修复程序:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/ojdbc7-12.1.0.1.jar</systemPath>
</dependency>
But we reverted back at some point and it is working fine. 但是我们在某个时候恢复了,现在一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.