Hi Radu,

I'm running xmlbeans-2.4.0.jar - seems to be the latest and it still has the 
problem.

Regards,
Suire.

--- On Fri, 6/5/09, Radu Preotiuc-Pietro <radu.preotiuc-pie...@oracle.com> 
wrote:

From: Radu Preotiuc-Pietro <radu.preotiuc-pie...@oracle.com>
Subject: RE: xmlobject stream closure upon parse affecting httpservletrequest 
application/xml
To: dev@xmlbeans.apache.org
Date: Friday, June 5, 2009, 6:19 PM



 
I would try the Java default one.
 
What version of XMLBeans are you using? We had a bug like 
that a while ago where the stream was being closed inadvertently, but 
it has since been fixed.
 
Radu


  
  
  From: Suire Rekv [mailto:suirer...@yahoo.com] 
  
Sent: Thursday, June 04, 2009 7:20 PM
To: 
  dev@xmlbeans.apache.org
Subject: Re: xmlobject stream closure upon 
  parse affecting httpservletrequest application/xml


  
  
    
    
      The container is spring/tomcat. I'm not setting anything, 
        so it must be using the default. Also, I tested the same xsd with JAXB 
        and it has no problem with cxf.

I can try setting the xmloptions. 
        Which parser do you suggest.?

Also can you tell me if the parse 
        method of xmlbeans closes the stream?
The wierd thing is that the 
        first request works, the second maybe, the third or fourth fails.
But 
        once the failure happens, alternate requests fail consistently, unless 
        tomcat is restarted.

- Suire.

--- On Thu, 6/4/09, Radu 
        Preotiuc <radu.preotiuc-pie...@oracle.com> wrote:

        
From: 
          Radu Preotiuc <radu.preotiuc-pie...@oracle.com>
Subject: Re: 
          xmlobject stream closure upon parse affecting httpservletrequest 
          application/xml
To: dev@xmlbeans.apache.org
Date: Thursday, June 
          4, 2009, 6:17 PM


          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-unsubscr...@xmlbeans.apache.org
For 
          additional commands, e-mail: dev-h...@xmlbeans.apache.org





      

Reply via email to