Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-2856

NoMessageBodyWriterFoundFailure when using NoJackson and json annotated resource

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Blocker
    • None
    • 7.0.0.ER4
    • REST
    • None
    • Regression
      • unzip attached reproducer
      • mvn clean verify -Djboss.home=/path/to/eap

    Description

      This is a regression in comparisson to EAP6 and therefore the priority is a blocker.
      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

              weli@redhat.com Weinan Li
              kanovotn Katerina Odabasi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: