Estou recebendo uma exception na hora de chamar o autentica e revisei o código todo e não consigo encontra.
javax.servlet.ServletException: net.vidageek.mirror.exception.ReflectionProviderException: Could not invoke method autentica
br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:120)
package br.com.caelum.vraptor.controller;
import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Get;
import br.com.caelum.vraptor.Post;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.dao.UsuarioDao;
import br.com.caelum.vraptor.model.Usuario;
import br.com.caelum.vraptor.validator.I18nMessage;
import br.com.caelum.vraptor.validator.Validator;
@Controller
public class LoginController {
private final UsuarioDao dao;
private final Result result;
private final Validator validator;
private final UsuarioLogado usuarioLogado;
public LoginController(UsuarioDao dao, Result result, Validator validator, UsuarioLogado usuarioLogado) {
this.dao = dao;
this.result = result;
this.validator = validator;
this.usuarioLogado = usuarioLogado;
}
@Deprecated
public LoginController() {
this(null, null, null, null);
}
@Get
public void formulario( ) {
}
@Post
public void autentica(Usuario usuario) {
if(!dao.existe(usuario)){
validator.add(new I18nMessage("login", "login.invalido"));
validator.onErrorUsePageOf(this).formulario();
}
usuarioLogado.setUsuario(usuario);
result.redirectTo(ProdutoController.class).lista();
}
}
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.css">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Formulário de login</title>
</head>
<body>
<div class="conteiner">
<form class="form-signin" action="<c:url value='/login/autentica'/>" method="post">
<h2 class="form-signin-heading">Faça login para acessar o VRaptor-produtos</h2>
<input type="text" class="form-control" name="usuario.nome" placeholder="Nome"/>
<input type="password" class="form-control" name="usuario.senha" placeholder="Senha"/>
<button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
</form>
<c:if test="${not empty errors }">
<div class="alert alert-danger">
<c:forEach var="error" items="${errors}">
${error.category } - ${error.message }<br>
</c:forEach>
</div>
</c:if>
</div>
</body>
</html>