我不明白是什么导致Bean创建异常代表返回所需的相同类。
课程是
com.mchange.v2.c3p0.ComboPooledDataSource
,错误显示
预计
回来
的实例[
通用域名格式。McChange。v2.c3p0。组合池数据源
]但是
返回
的实例[
通用域名格式。McChange。v2.c3p0。组合池数据源
]
这是错误:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dataSourceGCA' defined in class path resource [META-INF/xxxxx-security-app.xml]:
Invocation of init method failed; nested exception is javax.naming.NamingException:
The local resource link [dataSourceGCA2] that refers to global resource [jdbc/dataSourceGCA2Global] was expected to return an instance of [com.mchange.v2.c3p0.ComboPooledDataSource] but returned an instance of [com.mchange.v2.c3p0.ComboPooledDataSource]
我正在使用Java 7和Tomcat 7。
这是数据源的配置:
在里面
上下文xml
:
<ResourceLink name="jdbc/dataSourceGCA2"
global="jdbc/dataSourceGCA2Global"
auth="Container"
type="com.mchange.v2.c3p0.ComboPooledDataSource" />
在里面
服务器xml
:
<Resource description="whatever"
name="jdbc/dataSourceGCA2Global"
auth="Container"
factory="org.apache.naming.factory.BeanFactory"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
user="xxxxxxxx"
password="xxxxxxxx"
initialPoolSize="1"
minPoolSize="1"
maxPoolSize="5"
acquireIncrement="1"
driverClass="oracle.jdbc.driver.OracleDriver"
jdbcUrl="jdbc:oracle:thin:@tprodva2:1522/BD2"
testConnectionOnCheckin="true"
idleConnectionTestPeriod="300"
maxIdleTimeExcessConnections="0"
maxIdleTime="0" />
是什么导致这种行为?
非常感谢您的帮助。