java Spring與hibernate整合時出現錯誤,NotWritablePropertyException

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章