XStream
  1. XStream
  2. XSTR-704

Getting HttpMessageNotReadableException while using XStream 1.3.1 with Spring 3.0.2

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.3.1
    • Fix Version/s: None
    • Component/s: Converters
    • Labels:
      None
    • JDK version and platform:
      JDK 1.6, Windows

      Description

      Recently facing an issue with XStream which i'm using with Spring. We have a REST application where we are using XStream for marshalling & unmarshalling XML.
      We have configured as shown below,

      <bean id="xStreamMarshaller" class="org.springframework.oxm.xstream.XStreamMarshaller">
      <property name="annotatedClasses">
      <list><value>com.repobjects.OfflineOrderRepresentation</value></list>
      </property>
      <property name="autodetectAnnotations" value="true" />
      </bean>

      And this XStreamMarshaller is configured to HttpMessageconverter as shown,

      <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
      <property name="messageConverters">
      <util:list>
      <bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
      <property name="marshaller" ref="xStreamMarshaller" />
      <property name="unmarshaller" ref="xStreamMarshaller" />
      </bean>
      </util:list>
      </property>
      </bean>

      The issue here is when i post proper XML it should match to it's corresponding XStream annotated class "OfflineOrderRepresentation",
      but that is happening randomly, some times i'm getting syntactically incorrect message, and issue is getting fixed randomly if i restart the server.

      Below is the error logs i'm getting,

      [org.springframework.http.converter.xml.MarshallingHttpMessageConverter@712625b0]
      [org.springframework.web.bind.annotation.support.HandlerMethodInvoker]
      Reading [com.repobjects.OfflineOrderRepresentation]
      [org.springframework.http.converter.xml.MarshallingHttpMessageConverter@712625b0]
      [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver]
      [controllers.OrderController@799a92d1]:
      org.springframework.http.converter.HttpMessageNotReadableException: Could not read [class com.repobjects.OfflineOrderRepresentation];

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Ganesh Kandisa
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: