嗨,大家好我用hibernate和spring创建了一个简单的web应用程序,我想实现一个包含crud操作的抽象类,但是我有这个错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientService' defined in class path resource [applicationContext.xml]:
Cannot resolve reference to bean 'clientDao' while setting bean property 'clientDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'clientDao' defined in class path resource [applicationContext.xml]:
Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.Class]:
GenericDao
public interface GenericDao
}
GenericDaoImpl
@Transactional
public class GenericDaoImpl
ClientDao
public interface ClientDao extends GenericDao
ClientDaoImpl
@Transactional
@Repository("clientDao")
public class ClientDaoImpl extends GenericDaoImpl
application context.xml
最佳答案
原文链接:https://www.f2er.com/spring/432654.html