Skip to content

XmlBeans UnMarshalling - does not work with RequestBody annotation [SPR-7034] #11696

Closed
@spring-projects-issues

Description

@spring-projects-issues

Tyler Vallillee opened SPR-7034 and commented

When unmarshalling controller parameters using the "@RequestBody" annotation and XmlBeans, I get spurious unmarshalling exceptions: "Unexpected end of file after null" These errors seem to be pretty consistent after the first request

XmlBeans has identified this issue as an input stream problem: http://issues.apache.org/jira/browse/XMLBEANS-226

It looks like Spring may not be handling input streams in an XmlBeans-friendly manner.

Here is my unmarshaller config:

 <!-- XML Marshalling -->
 <bean id="inboundMessageAdapter" 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="xmlMarshaller"/>
                <property name="unmarshaller" ref="xmlMarshaller"/>
            </bean>
        </util:list>
    </property>
</bean>
<bean id="xmlMarshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller"/>

Here is my controller method:

@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public SampleResponseDocument doMethod(@RequestBody SampleRequestDocument requestDocument) {
          
    return myservice.sampleMethod(requestDocument);

}

The method body is reached in the first invocation, but almost all subsequent invocations give the XmlBeans end of file error.

Please let me know if more information is needed


Affects: 3.0 GA

Referenced from: commits f836601

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions