spring 3.2 与mybatis 整合数据源出错的问题
配置文件如下:
<context:property-placeholder location="classpath*:conf/jdbc.properties" /><bean id="dataSource" value="${dba.jdbc.driverClassName}" /> <property name="url" value="${dba.jdbc.url}" /> <property name="username" value="${dba.jdbc.username}" /> <property name="password" value="${dba.jdbc.password}" /></bean><!--事务 --><bean id="transactionManager"ref="dataSource" /></bean><tx:annotation-driven transaction-manager="transactionManager" /><!-- 配置SqlSessionFactoryBean --><bean id="sqlSessionFactory" ref="dataSource" /> <property name="mapperLocations" > <list> <value>classpath*:com/cnnct/product/jftcardcs/dao/*.xml"</value> <value>classpath*:com/cnnct/system/dao/*.xml"</value> </list> </property></bean><!-- scan for mappers and let them be autowired --><bean value="com.cnnct.product.jftcardcs.dao,com.cnnct.Base" /></bean>
java.lang.IllegalStateException: Could not load JDBC driver class [${dba.jdbc.driverClassName}]
<!-- 配置SqlSessionFactoryBean --><bean ref="dataSource" /> <property name="mapperLocations" > <list> <value>classpath*:com/cnnct/product/jftcardcs/dao/*.xml"</value> <value>classpath*:com/cnnct/system/dao/*.xml"</value> </list> </property></bean>