Glassfish没有看到我的休息申请

时间:2016-06-08 15:44:16

标签: java rest glassfish glassfish-4 glassfish-4.1

我有RestApplication类:

@ApplicationPath("/orcr")
public class RestApplication extends Application {

    @Override
    public Map<String, Object> getProperties() {
        Map<String, Object> properties = new HashMap<>();
        properties.put("jersey.config.server.disableMoxyJson", true);
        properties.put("jersey.config.disableMoxyJson", true);

        return properties;
    }

还有一些资源:

@Slf4j
@Stateless
@Path("/unhold")
public class UnholdResource {

    @GET
    @Path("/test")
    public Response test() {
        return Response.ok("cool").build();
    }
}

我将它部署在我当地的glassfish4上。 一些日志:

org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer > Registering the Jersey servlet application, named lv.lpb.rest.RestApplication, at the servlet mapping /orcr/ *, with the Application class of the same name.
javax.enterprise.web > Loading application [orcr-unholder] at [/orcr-unholder-r75.6944126]
javax.enterprise.system.core > orcr-unholder was successfully deployed in 4,222 milliseconds.

但是,如果我尝试像网站的蚂蚁:

本地主机:8081 / orcr-unholder / orcr /不保持/测试

本地主机:8081 / orcr-unholder / orcr /不保持

本地主机:8081 / orcr-unholder / orcr

本地主机:8081 / orcr /不保持/测试

本地主机:8081 / orcr /不保持

它总是404 Not Found

localhost:8081 - 服务器正在运行

那么,它会是什么?

解决

正确的网址是:localhost:8081 / orcr-unholder-r75.6944126 / orcr / unhold / test

0 个答案:

没有答案