javax.ws.rs.NotFoundException: Could not find resource for full path with RESTEasy and Wildfly 8.1.0.Final

前端 未结 7 2172
长情又很酷
长情又很酷 2020-12-06 01:59

I am facing following problem. I have spent more than 3 days on this but cannot find a solution. Please guide me what I am doing wrong here. I am new to Resteasy with wildfl

7条回答
  •  心在旅途
    2020-12-06 02:25

    Its hard to say for sure, but one thing I see is that you are passing a parameter but not mapping any parameter in the URL. This would be more correct:

    @GET
    @Path("/getUser/{id}")
    @Produces(MediaType.APPLICATION_JSON)
    public UserWsPojo getUser(@PathParam("id") String id) {
      // do things with stuff
    }
    

    And then the full URL would be /admin-ws/services/user/getUser/1 to get a user with ID 1.

提交回复
热议问题