Error creating bean with name 'departmentservice' defined in class path resource [spring/applicationContext-department.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'departmentoneDao' of bean class [com.ssh.service.Iml.Departmnetserviceiml]: Bean property 'departmentoneDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
xml部分配置文件如下:
<bean id="departmentone" class="com.ssh.dao.daoiml.Departdaoiml">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="abc" class="com.ssh.service.Iml.Departserviceiml">
<property name="departmentone25">
<ref bean="departmentone"/>
</property>
</bean>
仔細檢查後發現實黑體加粗的地方寫作了,這裏的name名字,應該是set方法中屬性的名字一樣。