0

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();     
}
Community
  • 1
  • 1
Anthony Tsivarev
  • 881
  • 3
  • 13
  • 25

1 Answers1

0

The problem was that I started another soap service on another server (the same port, but different context) It remains a mystery why I was able to get through the browser.

Anthony Tsivarev
  • 881
  • 3
  • 13
  • 25