我在用注解写对应数据库的映射文件时候 搞了个单元测试 结果就报了异常 :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDao': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.orm.hibernate3.HibernateTemplate com.lesta.core.dao.impl.BaseDao.hibernateTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [modules/spring.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [modules/spring.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Collection has neither generic type or OneToMany.targetEntity() defined: com.lesta.gaojing.model.Bkaction.bukongs