Pessoal, boa tarde!
Preciso da ajuda de vocês.
Tento acessar minha aplicação no endereço http://localhost:8080/videoLocadoraTeste/cliente/lista e tá dando erro 404.
Quando subo a aplicação ela não dá erro nenhum como podem ver abaixo.
Minha jsp está dentro de WEB-INF/jsp/cliente/lista.jsp
Os orm.xml e persistence.xml estão dentro do src/META-INF
já tentei debugar o controller e nem chega lá.
Presciso da ajuda de vocês pois não sei mais o que fazer.
Log de subida:Nov 15, 2012 3:21:55 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/diogogama/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Nov 15, 2012 3:21:55 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:videoLocadoraTeste' did not find a matching property.
Nov 15, 2012 3:21:55 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 15, 2012 3:21:55 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1034 ms
Nov 15, 2012 3:21:55 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 15, 2012 3:21:55 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
Nov 15, 2012 3:21:56 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 15, 2012 3:21:56 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 15, 2012 3:21:56 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/61 config=null
Nov 15, 2012 3:21:56 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 843 ms
@Resource
public class ClienteController {
private final GenericDAO dao;
private final Result result;
public ClienteController(GenericDAO dao, Result result) {
this.dao = dao;
this.result = result;
}
@Path("/cliente/lista")
public void lista() {
List<BaseEntity> clientes = dao.selectByNamedQuery("selectClientes");
result.include("clientes", clientes);
}
@Path("/cliente/formulario")
public void formulario() {
}
@Path("/cliente/editar/{cliente.id}")
public void editar(Cliente cliente) {
cliente = (Cliente) dao.selectById(cliente);
if(cliente != null) {
result.include("cliente", cliente);
}
result.redirectTo(this.getClass()).formulario();
}
@Post
@Path("/cliente/salvar")
public void salvar(Cliente cliente) {
if(cliente != null) {
if(cliente.getId() == null) {
dao.insert(cliente);
} else {
dao.update(cliente);
}
}
lista();
result.redirectTo(this.getClass()).lista();
}
@Path("/cliente/excluir/{cliente.id}")
public void excluir(Cliente cliente) {
if(cliente != null && cliente.getId() != null) {
dao.remove(cliente);
}
lista();
result.redirectTo(this.getClass()).lista();
}
}
<%@page contentType="text/html"%>
<%@page pageEncoding="iso-8859-1"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<title>Video Locadora - Cliente : Listagem</title>
</head>
<body>
<center>
<a href="<c:url value="/cliente/formulario"/>">Novo</a>
<table width="500" border="1">
<thead>
<tr>
<td width="50">ID</td>
<td width="300">CPF</td>
<td width="300">Nome</td>
<td width="300">Endereço</td>
<td width="75">Editar</td>
<td width="75">Excluir</td>
</tr>
</thead>
<tbody>
<c:forEach items="${clientes}" var="cliente">
<tr>
<td>${cliente.id}</td>
<td>${cliente.cpf}</td>
<td>${cliente.nome}</td>
<td>${cliente.endereco}</td>
<td><a href="<c:url value="/usuario/editar/${usuario.id}"/>">Editar</a> </td>
<td><a href="<c:url value="/usuario/excluir/${usuario.id}"/>">Excluir</a></td>
</tr>
</c:forEach>
</tbody>
</table>
</center>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
<named-query name="selectFilmes">
<query>SELECT obj FROM tbFilme obj ORDER BY obj.filme</query>
</named-query>
<named-query name="selectClientes">
<query>SELECT obj FROM tbCliente obj ORDER BY obj.nome</query>
</named-query>
<named-query name="selectLocacoes">
<query>SELECT obj FROM tbLocacao obj ORDER BY obj.dataLocacao</query>
</named-query>
</entity-mappings>
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="vraptor">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>br.com.k2studio.vraptor.entity.Grupo</class>
<class>br.com.k2studio.vraptor.entity.Usuario</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/videoLocadora" />
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.username" value="u_videoLocadora" />
<property name="hibernate.connection.password" value="123456" />
</properties>
</persistence-unit>
</persistence>
Agradeço muito se me ajudarem.