配置applicationContext.xml出錯(cuò)
-- 添加 -->???? <!-- 配置業(yè)務(wù)層的類 -->???????????? <bean id="addService" class="com.zhang.service.addService">???? <property name="addDao" ref="addDao"></property>??? </bean>?????????????????????????????????????????? <!-- 配置Dao的類 -->????????????????????????????????????? <bean id="addDao" class="com.zhang.dao.addDao">???
報(bào)錯(cuò)了
???????? </bean>Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'addDao' of bean class [com.zhang.service.addService]: Bean property 'addDao' is not writable or has an invalid setter method. Did you mean 'adao'?
2018-03-20
Did you mean 'adao'?你的類里面取名是這個(gè),而你想用addDao,所以報(bào)錯(cuò)了,你檢查一下你的名稱是否一致,我的之前也報(bào)這個(gè)錯(cuò)誤,原因就是多了個(gè)空格,真的嚴(yán)格--,希望對(duì)你有幫助
2018-01-24
從這兩句話看沒錯(cuò),