我正在尝试使用 7.0.30 版的 tomcat-dbcp.jar 为 tomcat-dbcp 创建一个弹簧管理的独立池
然而,Tomcat 的文档(http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#Standalone)中似乎提到了 org.apache.tomcat.jdbc.DataSource 类
<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"
destroy-method="close">
<property name="factory"
value="org.apache.tomcat.jdbc.pool.DataSourceFactory" />
<property name="type" value="javax.sql.DataSource" />
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/ym" />
<property name="username" value="admin" />
<property name="password" value="admin" />
<property name="initialSize" value="5" />
<property name="maxActive" value="10" />
</bean>
所以这个spring bean定义根据Tomcat doc是正确的,但是当我启动应用程序时,我得到CNF异常:
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.tomcat.jdbc.pool.DataSource] for bean with name 'dataSource' defined in class path resource [application-context.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool.DataSource
我是不是超级愚蠢,在这里错过了明显的东西???