Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1283

NoMessageBodyWriterFoundFailure when using NoJackson and json annotated resource

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Critical
    • None
    • 3.0.14.Final
    • None
    • None
      • unzip attached reproducer
      • mvn clean verify -Djboss.home=/path/to/eap

    Description

      Using @NoJackson annotation with @Produces("application/json") should trigger jettison provider.

      My resource looks like this:

          @GET
          @Produces("application/json")
          @Path("{id}")
          @BadgerFish
          public Jackson2XmlProduct getProduct() {
              return new Jackson2XmlProduct(333, "Iphone");
          }
      

      Jackson2XmlProduct has @NoJackson annotation (see attached reproducer for more details)
      Sending GET to the EAP server running the above resource results to:

      18:46:05,790 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) RESTEASY002005: Failed executing GET /xml/products/333: org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: org.jboss.resteasy.test.Jackson2XmlProduct of media type: application/json
      	at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:66)
      	at org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:466)
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:415)
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
      	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      ...
      
      The expected outcome is that entity in json format will be returned.
      

      Attachments

        Issue Links

          Activity

            People

              rsigal@redhat.com Ronald Sigal
              kanovotn Katerina Odabasi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: