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方法中属性的名字一样。