org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: com.MyClass of media type: application/json

Stack Overflow | vimal prakash | 3 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type

    Stack Overflow | 2 months ago | Karthik
    rg.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: com.karthik.SerializedStatusTO of media type: app lication/xml
  2. 0

    NoMessageBodyWriterFoundFailure resteasy

    Stack Overflow | 2 years ago | Ramesh
    org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: UserInfo of media type: application/json
  3. 0

    NoMessageBodyWriterFoundFailure resteasy - scriptscoop.com

    scriptscoop.com | 2 years ago
    org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: UserInfo of media type: application/json
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Using the built-in JAXB/JSON providers and the following classes; @Path( "/principals" ) @Produces( "application/xml" ) public interface Admin { @GET @Path( "/user" ) public User[] getUsers(); } @XmlRootElement public class User { @XmlAttribute private Integer id; @XmlElement private String name; } I got the following error: 41548 [http-8080-2] ERROR org.jboss.resteasy.core.SynchronousDispatcher - Failed executing GET principals/user org.jboss.resteasy.spi.LoggableFailure: Could not find MessageBodyWriter for response object of type: [LUser; of media type: application/xml at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:422) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:357) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:182) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:90) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:66) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) ... This is because the built-in JAXB providers are only isReadWritable for either JAXBElement class or @XmlRoolElement and @XmlType annotations. Same error if the returned type is a collection. There ought to be an easier way then writing one's own MessageBodyWriter for that.

    JBoss Issue Tracker | 9 years ago | Hai Nguyen
    org.jboss.resteasy.spi.LoggableFailure: Could not find MessageBodyWriter for response object of type: [LUser; of media type: application/xml
  6. 0

    Using the built-in JAXB/JSON providers and the following classes; @Path( "/principals" ) @Produces( "application/xml" ) public interface Admin { @GET @Path( "/user" ) public User[] getUsers(); } @XmlRootElement public class User { @XmlAttribute private Integer id; @XmlElement private String name; } I got the following error: 41548 [http-8080-2] ERROR org.jboss.resteasy.core.SynchronousDispatcher - Failed executing GET principals/user org.jboss.resteasy.spi.LoggableFailure: Could not find MessageBodyWriter for response object of type: [LUser; of media type: application/xml at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:422) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:357) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:182) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:90) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:66) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) ... This is because the built-in JAXB providers are only isReadWritable for either JAXBElement class or @XmlRoolElement and @XmlType annotations. Same error if the returned type is a collection. There ought to be an easier way then writing one's own MessageBodyWriter for that.

    JBoss Issue Tracker | 9 years ago | Hai Nguyen
    org.jboss.resteasy.spi.LoggableFailure: Could not find MessageBodyWriter for response object of type: [LUser; of media type: application/xml

    17 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure

      Could not find MessageBodyWriter for response object of type: com.MyClass of media type: application/json

      at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse()
    2. RESTEasy JAX-RS Implementation
      HttpServletDispatcher.service
      1. org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:69)
      2. org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:469)
      3. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418)
      4. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:205)
      5. org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
      6. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
      7. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
      7 frames
    3. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      1 frame
    4. Undertow Servlet
      ServletAuthenticationCallHandler.handleRequest
      1. io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      2. io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      3. io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      4. io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      5. io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      5 frames
    5. Undertow Core
      AbstractConfidentialityHandler.handleRequest
      1. io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      2. io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      2 frames
    6. Undertow Servlet
      ServletConfidentialityConstraintHandler.handleRequest
      1. io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      1 frame
    7. Undertow Core
      AuthenticationMechanismsHandler.handleRequest
      1. io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      1 frame
    8. Undertow Servlet
      CachedAuthenticatedSessionHandler.handleRequest
      1. io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      1 frame
    9. Undertow Core
      PredicateHandler.handleRequest
      1. io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      2. io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      3. io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      3 frames
    10. Undertow Servlet
      ServletInitialHandler$1.handleRequest
      1. io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
      2. io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
      3. io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
      4. io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
      5. io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      6. io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      7. io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
      8. io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      9. io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
      9 frames
    11. Undertow Core
      HttpServerExchange$1.run
      1. io.undertow.server.Connectors.executeRootHandler(Connectors.java:208)
      2. io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809)
      2 frames
    12. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames