I deploy rest web-service (Jersey) in embedded jetty.
My server:
Map<String,Object> initMap = new HashMap<String, Object>();
initMap.put("com.sun.jersey.api.json.POJOMappingFeature", "true");
initMap.put("com.sun.jersey.config.property.packages", "com.extern.rest");
ResourceConfig rc = new PackagesResourceConfig(initMap);
restServer = HttpServerFactory.create("http://localhost:5555/core-gw-rs/", rc);
restServer.start()
My client:
URL url = new URL(buildUrl(params, path));
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setDoInput(true);
connection.connect();
When I do a query from a client, in response I receive a status of 404. When a request is made by a browser to the same address get required result (200 status).
Update
Method:
@GET
@Path("{accountUuid}/domain/rfc822")
public Response fetchData(@PathParam("accountUuid") String accountUuid) {
return Response.ok().build();
}