I have a Interface:and a implementing abstract class:Code:public interface IGenericDAOThen there are class that extends the abstract class like:Code:@Repository public abstract class GenericDAOImpl implements IGenericDAOWhen i try to autowire ClientDAO into serverice as below:Code:@Repository public class ClientDAO extends GenericDAOImplIt throws exception below:Code:@Component public class ClientServiceImpl implements ClientService{ private ClientDAO clientDAO; @Autowired public void setClientDAO(Object clientDAO) { this.clientDAO = clientDAO; }
Code:Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.xxx.service.impl.ClientServiceImpl.setClientDao(com.xxx.dao.ClientDAO); nested exception is java.lang.IllegalArgumentException: argument type mismatch


Reply With Quote