java - Jersey REST error, MessageBodyWriter not found for media type=application/json -
I did not find the messaging recorder when I called for a web service call.
I have included I have also tried without registering "GensonJsonConverter.class" and still gives the same error web.xml Part of stack trace: 1) Metanoff-Services Add Dependency to OR 2) Register it programmatically. Edit As you do not create all such as there is an explanation in more detail with advice. For the Container Program you will find it easy to use the Metannoff-Services solution. genson-1.1.jar in my square path, which I believe is to include messaging implementation, I still get this error < P> I am using Jersey 2.13.
protected zero doPost (HttpServletRequest request, HttpServletResponse resp) ServletException, IOException {ClientConfig config = new ClientConfig () throws; WebText target = client.target ("http: // localhost: 8080 / web services / comfort / hello"); Target.path ("Lion King"); Target.register (GensonJsonConverter.class); String response = target. request (). Accept (MediaType.APPLICATION_JSON) .get (String.class); Resp.getWriter () print (feedback). } @Path ("Hello") Public class greetings {@GET @Produces (MediaType.APPLICATION_JSON) public book getThisBook (@PathParam ("bookName") string bookName) {Return new book (bookName, "MSN", New Date) ); }}
Critical: MessageBodyWriter did not get to media type = application / json, type = class com.webservices.entity.book , Generic type = class com.webservices.entity.Book servlet.service () [myServlet] for reference with path [/ WebServices] in the context with reference javax.ws.rs.InternalServerErrorException threw: October 10, 2014 15:19 : 49 org.apache.catalina.core.StandardWrapperValve Great Call: HTTP 500 Internal Server Error
Comments
Post a Comment