-3
I’m doing a program for costume rental stores and I’m using Spring Boot.My mistakes are in the controller and dao.
Follow the necessary controller code:
@Controller
public class AluguelController extends HttpServlet {
@Autowired(required = true)
private ClienteDao dao;
@Autowired(required = true)
private AluguelRepository aluguelRepository;
@Autowired(required = true)
private ClienteRepository clienteRepository;
@Autowired(required = true)
private RoupaUtensiliosRepository roupaUtensiliosRepository;
@Autowired(required = true)
private TipoRoupaRepository tipoRoupaRepository;
@Autowired(required = true)
private RoupaUtensiliosDao rdao;
Follow the dao code needed:
public interface ClienteDao {
List<Cliente> getByNomeCli(String nomeCli);
}
Error shown by intellij:
APPLICATION FAILED TO START
Description:
Field dao in com.vitoria.trajes.controller.Aluguelcontroller required a bean of type 'com.vitoria.dao.Clientedao' that could not be found.
The Injection point has the following Annotations: - @org.springframework.Beans.factory.Annotation.Autowired(required=true)
Action:
Consider Defining a bean of type 'com.vitoria.dao.Clientedao' in your Configuration.
I did that and you keep making the same mistake.
– Vitória Poncio