这个奇怪的泽西警告意味着什么?

这个警告在泽西岛1.4中意味着什么:

WARNING: A sub-resource method, public final java.lang.String com.XXX.render(), with URI template, "/", is treated as a resource method 

这是方法的外观:

 @GET @Produces(MediaType.APPLICATION_XML) @Path("/") public final String render() { return "test"; } 

为什么需要为方法指定这样的路径? @Get足以告诉jersey它是整个类的默认方法(我假设你的类有一些@Path(“/ MyRes”)注释)。

看起来你上周遇到了同样的问题如何有条件地路由JAX-RS请求,具体取决于后缀? – 运气好吗?

在网上浏览一下就会发现你可能错误地设置了你的构造函数 – 请阅读http://jersey.576304.n2.nabble.com/Problem-using-the-JerseyTest-class-td3256608.html-有人谁有类似的问题,并能够解决它。