在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