NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object

The following stacktrace exception is thrown when trying to do a REST

org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: could not find MessageBodyWriter for response object type: java.lang.Boolean media type: application / octet-stream         on org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse (ServerResava ) at org.jboss.resteasy.core.SynchronousDispatcher.writeResponse (SynchronousDispatcher.java:448) at org.jboss.resteasy.core.SynchronousDispatcher.invoke (SynchronousDispatcher.javahaps97) at org.jboss.resteasy.core.Asynchron. invoke (AsynchronousDispatcher.java:253) at org.jboss.resteasy.core.SynchronousDispatcher.invoke (SynchronousDispatcher.java:200)

I tried several sentences in another entry in stackoverflow and beyond, including 1. Make sure there are banks for "resteasy-jaxb-provider-3.0.12.Final.jar" and drop providers 2. Even have any of them, as well not both 3. Change another version of jaxrs jar

So far, I have been able to conclude:

  • The problem is on the server, not on the client. The client simply receives a 500 HTTP error code
  • The server site to which the request is distributed, but the response is not sent back
  • If you carefully check the error, I get a response, I can not find "application / octec-stream", although I defined "application / json" in the service metadata. SO somehow not sure why the application cannot get json parser

    @Path("/api/ver1.0/lock")
    public interface LockingService {
    
        /**
         * Interface method to request a single lock.
         *
         * @param lockRequest
         *            lockRequest
         * @return Boolean
         */
        @POST
        @Path("/request")
        @Consumes("application/json")
        Boolean requestLock(LockRequest lockRequest);
    
  • I can do the same code with all the same except for the resteasy banner version ie

IN

resteasy-jackson-provider-2.3.1.GA.jar
resteasy-jaxb-provider-2.3.1.GA.jar
resteasy-jaxrs-2.3.1.GA.jar
resteasy-jettison-provider-2.3.1.GA.jar
resteasy-multipart-provider-2.3.1.GA.jar
resteasy-spring-2.3.1.GA.jar
scannotation-1.0.3.jar

Does not work

resteasy-jackson-provider-3.0.12.Final.jar
resteasy-jaxb-provider-3.0.12.Final.jar
resteasy-jaxrs-3.0.12.Final.jar
resteasy-multipart-provider-3.0.12.Final.jar
resteasy-spring-3.0.12.Final.jar

.

+4

Source: https://habr.com/ru/post/1621826/


All Articles