org.springframework.beans.factory.BeanCreationException
ERROR [localhost-startStop-1] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productService' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'cn.muke.ssh.service.ProductService' to required type 'cn.muke.ssh.dao.ProductDao' for property 'productDao'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [cn.muke.ssh.service.ProductService] to required type [cn.muke.ssh.dao.ProductDao] for property 'productDao': no matching editors or conversion strategy found
?求大神回答這什么問題 萬分感謝!
2017-04-08
這個應(yīng)該是bean的id名字的問題,注意字母大小寫
<!--配置action層 ?-->
<bean id="productaction" class="com.action.ProductAction" scope="prototype">
<property name="productservice" ref="productservice"></property>
</bean>
<!--配置service層 ?-->
<bean id="productservice" class="com.service.ProductService">
<property name="productdao" ref="productdao"></property>
</bean>
<!--配置dao層 ?-->
<bean id="productdao" class="com.dao.ProductDao">
</bean>