问题描述
限时送ChatGPT账号..我正在使用 apache-tomcat-6.0.37,spring 2.5.6 和 tomcat-jdbc-7.0.19.在 xml 文件中配置 org.apache.tomcat.jdbc.pool.DataSource 时,我收到此错误:
I am using apache-tomcat-6.0.37, spring 2.5.6 and tomcat-jdbc-7.0.19.When configuring org.apache.tomcat.jdbc.pool.DataSource in xml file, I am getting this error:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.tomcat.jdbc.pool.DataSource].
spring 2.5.6 不支持 tomcat-jdbc-7.0.19 吗?需要更高版本的spring吗?目前我无法转移到更高版本.我需要符合吗?
Does spring 2.5.6 does not support tomcat-jdbc-7.0.19? Do it need higher version of spring? At this current moment I can not shift to higher version. Do I need to get conform?
推荐答案
首先你的 JAR 已经过时了.
Your JARs are outdated first of all.
更新到最新的 Tomcat JDBC 池将该 JAR 和放入$CATALINA_*/lib
和 nowhere else (*
==HOME
或 BASE
)在您的 context.xml
中声明您的 DataSource
使用 JNDI 查找从您的 beans.xml
中检索该 DataSource
Update to the most recent Tomcat JDBC Pool
Put that JAR and your driver into $CATALINA_*/lib
and nowhere else (*
== HOME
or BASE
)
Declare your DataSource
in your context.xml
Retrieve that DataSource
from your beans.xml
with a JNDI lookup
只要您运行 Java 6,Tomcat JDBC 池就可以与 Tomcat 6 完美配合.
Tomcat JDBC Pool works flawlessly with Tomcat 6 as long as your run Java 6.
这里是一个非常相似的问题.
Here is a very similar question.
这篇关于tomcat jdbc 和 spring 版本兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论