Eventuali collegamenti su come integrare Jetty e RESTEasy? Sono un po 'bloccato cercando di configurare RESTEasy con Jetty insieme ... e sembra che non ci sia un aiuto credibile sul web.Integrazione di Jetty 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();
}
mio Web.xml viene copiato direttamente da: http://docs.jboss.org/resteasy/docs/1.0.0.GA/userguide/html/Installation_Configuration.html
L'errore che ottengo sul retro è un HTTP 404 quando si tenta di aprire un collegamento nel mio file di risorse. Tutto sembra ragionevole in superficie, qualche suggerimento?
mio file di risorse appare come:
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";
}
}
Questa è la stampa che vedo quando Jetty si avvia:
2012-04-10 09: 54: 27,163: INFO: oejs.Server: jetty-8.1.1.v20120215 2012-04-10 09: 54: 27.288: INFO: oejw.StandardDescriptorProcessor: NO supporto JSP per /, non trovato org.apache.jasper.servlet.JspServlet 2012-04-10 09:54 : 27.319: INFO: oejsh.ContextHandler: avviato oejwWebAppContext {/, file:/C:/Users/xyz/Anotherproj1/src/webapp} 2012-04-10 09: 54: 27.319: INFO: oejsh.ContextHandler: avviato oejw WebAppContext {/, file:/C:/Users/xyz/Anotherproj1/src/webapp} 2012-04-10 09:54: 27.381: INFO: oejs.AbstractConnector: avviato [email protected]: 8080
In un primo glace questo sembra corretto. Quale versione di Jetty stai usando. Ci sono messaggi di errore? Qual è esattamente il tuo problema? – andih
@andih L'errore è essenzialmente un HTTP 404 quando provo ad aprire un collegamento nel mio file di risorse. – rmoh21
@andih Sto usando il Jetty 8.1.1 – rmoh21