当前位置: 代码迷 >> .NET Framework >> Caused by: org.springframework.beans.factory.BeanCreationException: .
  详细解决方案

Caused by: org.springframework.beans.factory.BeanCreationException: .

热度:132   发布时间:2016-05-02 00:18:19.0
Caused by: org.springframework.beans.factory.BeanCreationException: ...
在SSH项目整合中遇到的exception,弄了我大半天,累死了。

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loanArchive' defined in ServletContext resource [/WEB-INF/classes/config/spring/spring-service-archives-wyh.xml]: Cannot resolve reference to bean 'loanArchiFinder' while setting bean property 'loanArchiveFinder'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loanArchiFinder' defined in ServletContext resource [/WEB-INF/classes/config/spring/spring-service-archives-wyh.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required

原因:我注入一个finder类到service类中,由于这个finder类继承了一个类,我注入的时候没有指明,导致此异常。

解决:在注入的时候使用“parent”属性指明这个注入类的父类。

<bean name="archivesResonFinder"    class="com.lovo.loan.service.finder.impl.ArchivesRestitutionLogFinder" parent="abstractFinder">
</bean>
代码迷推荐解决方案:org.springframework.beans.factory.BeanCreationException:,http://www.daimami.com/j2ee/10759.html
  相关解决方案