简体   繁体   English

在嵌入式码头中找不到

[英]Not found in embedded jetty

I deploy rest web-service (Jersey) in embedded jetty. 我在嵌入式码头部署其余的Web服务(Jersey)。

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). 当我从客户端进行查询时,作为响应,我会收到404状态。当浏览器向同一地址发出请求时,会得到所需的结果(200个状态)。

Update 更新资料

Method: 方法:

@GET
@Path("{accountUuid}/domain/rfc822")
public Response fetchData(@PathParam("accountUuid") String accountUuid) { 
    return Response.ok().build();     
}

问题是我在另一台服务器上(同一端口,但上下文不同)启动了另一个肥皂服务。为什么能够通过浏览器仍然是一个谜。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM