Boa tarde pessoal, estou começando a utilizar as anotações do Spring e ao realizar o deploy da minha aplicação estou recebendo o seguinte erro:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'equipamentoBusinessImpl': Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.faro.meutreino.dao.EquipamentoDAO]: Error creating bean with name 'equipamentoDAOImpl': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required
Na minha Business/Service fiz o seguinte:
@Service
public class EquipamentoBusinessImpl implements EquipamentoBusiness {
private EquipamentoDAO equipamentoDAO;
@Autowired
public EquipamentoBusinessImpl(EquipamentoDAO equipamentoDAO) {
this.equipamentoDAO = equipamentoDAO;
}
public DataModel listaEquipamento() {
return equipamentoDAO.listaAllDataModel();
}
public List<Equipamento> findAll() {
return equipamentoDAO.loadAll();
}
}
Encontrei algumas implementações onde a anotação @Autowired é colocada no private EquipamentoDAO equipamentoDAO;