我已经使用WSO2 MSF4J创建了一个示例微服务。但我无法访问子资源(服务)。以下是我的服务班。
讯息资源-
@Path("/messages")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class MessageResource {
@Path("/{messageId}/comments")
public CommentResource getCommentResource(){
System.out.println("inside the getCommentResource method");
return new CommentResource();
}
}评论资源-
@Path("/")
public class CommentResource {
@GET
@Path("/{commentId}")
public String test2(@PathParam("messageId") long messageId, @PathParam("commentId") long commentId){
System.out.println("method to return comment Id : " + commentId + " for message : " + messageId);
return "method to return comment Id : " + commentId + " for message : " + messageId;
}
}我使用了以下URI来访问此服务。
GET:http://localhost:8080/messages/1/comments/5
但我得到了我的REST客户的跟踪结果。
404 Not Found
Problem accessing: /messages/1/comments/5. Reason: Not Found请帮忙解决这个问题。
发布于 2016-05-03 01:33:29
这是不支持的。MSF4J并不声称100%兼容JAXRS,但它是构建微服务的轻量级框架。我已经为此创建了JIRA 1。我们将在以后的发行版中实现这一点。
https://stackoverflow.com/questions/36954140
复制相似问题