org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userKissflyService' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userKissflyDAO' of bean class [com.guigu.store.service.UserKissflyService]: Bean property 'userKissflyDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
其中一个很可能的原因是你忘记在Service中注入DAO了,所以快检查写Service中有没有提供DAO的set/get方法。
本文分析了一个关于Spring框架中Bean创建失败的问题,具体错误为在加载applicationContext.xml配置文件时,无法正确设置UserKissflyService Bean的属性值,详细讨论了可能是由于未在Service类中正确提供DAO的setter方法导致的这一常见问题。

676

被折叠的 条评论
为什么被折叠?



