`

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>
1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics