67,512
社区成员
发帖
与我相关
我的任务
分享
public abstract class BaseDaoImpl<E extends Serializable, PK extends Serializable>
extends HibernateDaoSupport implements BaseDao<E, PK> {
/**
* 实体类的类型
*/
private Class<?> entityClass;
/**
*
* @return 泛型的类型
*/
public Class<?> getEntityClass() {
return entityClass;
}
private SessionFactory localSessionFactory;
/**
*
* @param factory
*/
@Resource(name = "sessionFactory")
public void setLocalSessionFactory(Object sessionFactory) {
try {
System.out.println("--------------"+sessionFactory.getClass());
/*
* this.localSessionFactory = sessionFactory;
* System.out.println(localSessionFactory);
* setSessionFactory(localSessionFactory); */
System.out.println("success..........................");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dicitonaryDao' defined in file [G:\erp\erp\web\WEB-INF\system\spring-system.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required