You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Radu Preotiuc <ra...@oracle.com> on 2009/06/04 20:17:06 UTC

Re: xmlobject stream closure upon parse affecting httpservletrequest application/xml

What makes you think this is not a problem with the container in the way
it handles the stream?

With XMLBeans, you can usually change the parser with
XmlOptions.setLoadUseXMLReader(). If you change the parser and the
problem persists, that would be a strong indication that the problem is
in the container.

Radu

On Sat, 2009-05-30 at 11:54 -0700, Suire Rekv wrote:
> Hi,
> 
> When I use XmlObject.Factory.parse(InputStream is) to read the request
> object's InputStream for request type application/xml I sporadically
> get errors as attempting to read from a closed stream. This problem
> happens directly when I read it from a spring controller or via cxf.
> 
> To fix this I had to parse the inputstream to a string and then
> construct the xmlobject from the string. By default the cxf xmlbeans
> provider reads the stream directly and cannot be used as such.
> 
> To test this:
> 
> public ModelAndView handleRequest(HttpServletRequest request,
> HttpServletResponse response)
>     throws ServletException, IOException, Exception {
>              XmlObject.Factor.parse(request.getInputStream());       
> }
> 
> Try hitting the webpage multiple times and you will the exception.
> 
> Any suggestions?
> 
> Thanks,
> Suire.
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org