I am trying to test my web application by running the Jetty server in the BeforeClass method in my JUnit test case, and then using HttpClient to form a server request. I start the server without any problems, but I keep getting 404 when I try to make a request.
My server configuration is as follows:
public void start() throws Exception { if (server == null) { server = new Server(PORT); server.setStopAtShutdown(true); wac = new WebAppContext(); wac.setContextPath("/app"); wac.setResourceBase("war"); wac.setClassLoader(this.getClass().getClassLoader()); server.addHandler(wac); server.start(); } }
Is there something wrong with my config? The server is working, and I see that I click it, it simply cannot find any resources.
source share