¿Algún enlace sobre cómo integrar Jetty y RESTEasy? Estoy un poco atascado tratando de configurar RESTEasy con Jetty juntos ... y parece que no hay ayuda creíble en la web.Embarcadero de integración con RESTEasy
public static void main(String[] args) throws Exception
{
Server server = new Server(8080);
WebAppContext context = new WebAppContext();
context.setDescriptor("../WEB-INF/web.xml");
context.setResourceBase("../src/webapp");
context.setContextPath("/");
context.setParentLoaderPriority(true);
server.setHandler(context);
server.start();
server.join();
}
Mi Web.xml se copia directamente de: http://docs.jboss.org/resteasy/docs/1.0.0.GA/userguide/html/Installation_Configuration.html
El error que consigo de vuelta es un HTTP 404 cuando intento abrir un enlace en mi archivo de recursos. Todo parece razonable en la superficie, ¿alguna sugerencia?
Mi archivo de recursos se ve así:
package webapp;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@Path("/*")
public class Resource {
@GET
public String hello() {
return "hello";
}
@GET
@Path("/books")
public String getBooks() {
return "books";
}
@GET
@Path("/book/{isbn}")
public String getBook(@PathParam("isbn") String id) {
return "11123";
}
}
Ésta es la impresiones que veo cuando embarcadero se pone en marcha:
2012-04-10 09: 54: 27.163: INFO: oejs.Server: jetty-8.1.1.v20120215 2012-04-10 09: 54: 27.288: INFORMACIÓN: oejw.StandardDescriptorProcessor: NO JSP Support for /, no encontró org.apache.jasper.servlet.JspServlet 2012-04-10 09:54 : 27.319: INFO: oejsh.ContextHandler: started oejwWebAppContext {/, file:/C:/Users/xyz/Anotherproj1/src/webapp} 2012-04-10 09: 54: 27.319: INFORMACIÓN: oejsh.ContextHandler: started oejw WebAppContext {/, file:/C:/Users/xyz/Anotherproj1/src/webapp} 2012-04-10 09:54: 27.381: INFO: oejs.AbstractConnector: Comenzó [email protected]: 8080
A primera vista esto parece correcto. ¿Qué versión de Jetty estás usando? ¿Hay algún mensaje de error? ¿Cuál es exactamente tu problema? – andih
@andih El error básicamente es un HTTP 404 cuando trato de abrir un enlace en mi archivo de recursos. – rmoh21
@andih Estoy usando Jetty 8.1.1 – rmoh21