日期:2014-05-18  浏览次数:20593 次

这个问题解决了,给40分儿
Exception in thread "main" org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'datasource' must be of type [javax.activation.DataSource], but was actually of type [com.mchange.v2.c3p0.ComboPooledDataSource]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:348)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1048)
at study.BeanTest.main(BeanTest.java:12)
spring

------解决方案--------------------
import javax.activation.DataSource;包引入错了,应该是javax.sql.DataSource;
------解决方案--------------------
引用:
import javax.activation.DataSource;包引入错了,应该是javax.sql.DataSource;

正解!异常信息不是很明确的说了类型不匹配吗?楼主包导错啦!