亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

Error creating bean with name 'productService' defined in class path resource

具體錯誤如圖

http://img1.sycdn.imooc.com//58e64e6f0001ad6f18330745.jpg


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productService' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'productDao' of bean class [cn.cheng.ssh.service.ProductService]: Bean property 'productDao' 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:1568)
?? ?at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1276)
?? ?at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
?? ?at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
?? ?at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
?? ?at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
?? ?at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
?? ?at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
?? ?at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
?? ?at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
?? ?at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
?? ?at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
?? ?at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
?? ?at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
?? ?at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4754)
?? ?at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5216)
?? ?at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
?? ?at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
?? ?at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
?? ?at java.util.concurrent.FutureTask.run(Unknown Source)
?? ?at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
?? ?at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
?? ?at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'productDao' of bean class [cn.cheng.ssh.service.ProductService]: Bean property 'productDao' 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.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243)
?? ?at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:437)
?? ?at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:292)
?? ?at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:280)
?? ?at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
?? ?at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
?? ?at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1564)
?? ?... 22 more

正在回答

5 回答

你好,我也是這個問題,你解決了么?

0 回復 有任何疑惑可以回復我~

有jar包嗎


0 回復 有任何疑惑可以回復我~

在applicationContext的xml文件中,找到配置的Action類,Crtl+右鍵點一下屬性名和參照,看能否跳轉,尤其是id要和dao,service或者action中的私有變量名稱要一致。

0 回復 有任何疑惑可以回復我~

在applicationContext的xml文件中,找到配置的Action類,Crtl+右鍵點一下屬性名和參照,看能否跳轉,尤其是id要和dao,service或者action中的私有變量名稱要一致。

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

Error creating bean with name 'productService' defined in class path resource

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號