我不知道标题是否令人困惑,但让我们说我有这个界面: 
  
  
 
@Produces(MediaType.APPLICATION_JSON)
@Path("/user")
public interface UserService {
    @GET
    @Path("/{userId}")
    public Response getUser(@PathParam("userId") Long userId);
} 
 为什么当我尝试实现一个版本Eclipse重写注释的覆盖方法,但不是为类?
class UserServiceImpl implements UserService {
    @Override
    @GET
    @Path("/{userId}")
    public Response getUser(@PathParam("userId") Long userId) {
        // Todo Auto-generated method stub
        return null;
    }
} 
 我正在尝试为休息的Web服务创建一个标准定义,然后具有不同的实现.是否可以使用标准jax-rs?我有任何机会使用错误的注释吗?
解决方法
 只有在实现类上不使用任何jax-rs注释时,才可以使用注释继承:它在JSR-339的第3.6节中说明. 
  
 
        您为方法重新定义@Path和@Produces,但不为该类定义.
所以你的代码中的Path注释应该在具体的类上:
public interface UserService {
    @GET
    @Path("/{userId}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getUser(@PathParam("userId") Long userId);
}
@Path("/user")
class UserServiceImpl implements UserService {
    @Override
    @GET
    @Path("/{userId}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getUser(@PathParam("userId") Long userId) {
        // Todo Auto-generated method stub
        return null;
    }
} 
 BTW,规范鼓励我们复制具体类的注释:
For consistency with other Java EE specifications,it is recommended to always repeat annotations instead of relying on annotation inheritance.