1. 程式人生 > >Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.itcast.j

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.itcast.j

報錯資訊:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.itcast.jk.dao.BaseDao]: Specified class is an interface

解決方法:重新拷貝application-dao.xml

其實是要把:      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
    http://www.springframework.org/schema/aop    
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 中的-3.0去掉這很重要
還有就是注意 //這裡是要引入實現類,不是介面,易錯 <bean id="deptService" class="cn.itcast.jk.service.impl.DeptServiceImpl"> <property name="baseDao" ref="baseDao"></property> </bean>