2 passionbloodwolf PassionBloodWolf 于 2015.05.25 11:07 提问

求大神帮我看下spring的问题

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service' defined in class path resource [beans.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'service' of bean class [com.bjlz.action.LCsiveAction]: Bean property 'service' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)
省略号,
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'service' of bean class [com.bjlz.action.LCsiveAction]: Bean property 'service' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
配置文件,
![![图片说明](http://img.ask.csdn.net/upload/201505/25/1432523221_850763.png)图片说明](http://img.ask.csdn.net/upload/201505/25/1432523215_711138.png)图片说明

7个回答

PassionBloodWolf
PassionBloodWolf   2015.05.26 17:25
已采纳

谢谢各位了 。。我找到了是少个了JAR包 导致的。。。

PassionBloodWolf
PassionBloodWolf   2015.05.25 11:08

图片说明

PassionBloodWolf
PassionBloodWolf   2015.05.25 11:08

图片说明
图片说明

kenzero
kenzero   2015.05.25 11:10

com.bjlz.action.LCsiveAction中需要增加setService方法

stvnshi
stvnshi   2015.05.25 11:27

把service方法改成setLzComprehensiveDao试下?或者你用的是那个版本的spring。直接在service的定义上面加上annotation。@Resource(name = "comprehdao")

stvnshi
stvnshi   2015.05.25 11:34
devmiao
devmiao   Ds   Rxr 2015.05.25 12:19

看下applicationcontent.xml的配置是否正确

Csdn user default icon
上传中...
上传图片
插入图片