0 Replies Latest reply on May 26, 2015 9:19 AM by fjarenales

    Unable to find a MessageBodyReader of content-t ype application/xml

    fjarenales

      Hi folks,

       

      I'm trying to send GET request to REST service, but I'm getting the next error:

       

      2015-05-26 12:35:44,147  WARN Runtime exception happened javax.ws.rs.ProcessingException: Unable to find a MessageBodyReader of content-type application/xml and type class com.vas.fabrixcommon.backend.data.En

      titlementIF

              at org.jboss.resteasy.core.interception.ClientReaderInterceptorContext.throwReaderNotFound(ClientReaderInterceptorContext.java:39)

              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:73)

              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:50)

              at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)

              at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)

              at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:248)

              at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:181)

              at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:217)

      ...

       

      The source code is:

       

      REST Service:

       

        @GET

        @Path("/Authorization")

        @Produces(MediaType.APPLICATION_XML)

        @Override

        public Response authorization(

         @QueryParam("serviceId") String serviceId,

         @QueryParam("homeId") String homeId,

            @QueryParam("aliasId") String aliasId,

            @QueryParam("channelId") String channelId,

            @QueryParam("programId") String programId,

            @QueryParam("action") Action action,

            @QueryParam("startTime") String startTime,

            @QueryParam("endTime") String endTime,

            @DefaultValue("epgbased") @QueryParam("recordingType") RecordingType recordingType,

            @QueryParam("recordingBufferRecording") boolean recordingBufferRecording,

            @QueryParam("addressType") AddressType addressType,

            @QueryParam("address") String address) {

      ...

       

       

      EntitlementIF class:

       

      @XmlAccessorType(XmlAccessType.FIELD)

      @XmlType(name = "", propOrder = {"channelsGrants", "subscribersChannelsGrantsUpdate", "epgNotification", "authorization",

          "subscribersLocationRestrictions"})

      @XmlRootElement(name = "EntitlementIF")

      public class EntitlementIF implements IdentifiedDataSerializable {

       

       

        @XmlElement(name = "ChannelsGrants")

        protected ChannelsGrants channelsGrants;

        @XmlElement(name = "SubscribersChannelsGrantsUpdate")

        protected SubscribersGrants subscribersChannelsGrantsUpdate;

        @XmlElement(name = "EPGNotification")

        protected EPGNotification epgNotification;

        @XmlElement(name = "Authorization")

        protected Authorization authorization;

        @XmlElement(name = "SubscribersLocationRestrictions")

        protected SubscribersGrants subscribersLocationRestrictions;

      ...

       

      I've also checked dependencies and all related to resteasy are included in my pom.xml

       

      <!-- RestEASY -->
      <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <version>${resteasyVersion}</version>
      <scope>compile</scope>
      <exclusions>
      <exclusion>
      <artifactId>commons-io</artifactId>
      <groupId>commons-io</groupId>
      </exclusion>
      </exclusions>
      </dependency>

       

       

      <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-client</artifactId>
      <version>${resteasyVersion}</version>
      <scope>compile</scope>
      </dependency>

       

       

      <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxb-provider</artifactId>
      <version>${resteasyVersion}</version>
      <scope>compile</scope>
      <exclusions>
      <exclusion>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jsr173_api</artifactId>
      </exclusion>
      </exclusions>
      </dependency>

       

       

      <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-spring</artifactId>
      <version>${resteasyVersion}</version>
      <scope>compile</scope>
      </dependency>

       

       

      <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jackson-provider</artifactId>
      <version>${resteasyVersion}</version>
      </dependency>

       

       

      <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>${servlet-apiVersion}</version>
      <scope>provided</scope>
      </dependency>

       

       

      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jms</artifactId>
      <version>${springframeworkVersion}</version>
      </dependency>

       

       

      <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>${gsonVersion}</version>
      </dependency>

       

       

      Any suggestion about it?

       

      Thanks in advance