[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    RE: xmlobject stream closure upon parse affecting httpservletrequest application/xml
From:       Suire Rekv <suirerekv () yahoo ! com>
Date:       2009-06-10 4:42:32
Message-ID: 649292.85571.qm () web46107 ! mail ! sp1 ! yahoo ! com
[Download RAW message or body]

hi Radu,
Unfortunately I have the time only to use it, but not test it :) I understand \
everyone in the xmlbeans is equally busy with other tasks. Hence I have moved to JAXB \
for now and that works without any problems.  I feel though xmlbeans is a great \
product defects like these and its inability to give pure value objects [it is now \
tied to xmlobject] might prove to be its undoing. Modern architectures require such \
abilities. application/xml - REST requests require this parsing to work seamlessly. \
Thanks,Suire.

--- On Mon, 6/8/09, Radu Preotiuc-Pietro <radu.preotiuc-pietro@oracle.com> wrote:

From: Radu Preotiuc-Pietro <radu.preotiuc-pietro@oracle.com>
Subject: RE: xmlobject stream closure upon parse affecting httpservletrequest \
                application/xml
To: dev@xmlbeans.apache.org
Date: Monday, June 8, 2009, 7:25 PM



 
 
 
So it must be something else then, it was worth checking... 
Try the parser change.
 
Radu


  
  
  From: Suire Rekv [mailto:suirerekv@yahoo.com] 
  
Sent: Friday, June 05, 2009 7:01 PM
To: 
  dev@xmlbeans.apache.org
Subject: RE: xmlobject stream closure upon 
  parse affecting httpservletrequest application/xml


  
  
    
    
      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-pietro@oracle.com> 
        wrote:

        
From: 
          Radu Preotiuc-Pietro 
          <radu.preotiuc-pietro@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:suirerekv@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-pietro@oracle.com> wrote:

                  
From: 
                    Radu Preotiuc 
                    <radu.preotiuc-pietro@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-unsubscribe@xmlbeans.apache.org
For 
                    additional commands, e-mail: dev-help@xmlbeans.apache.org



 



      


[Attachment #3 (text/html)]

<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: \
inherit;">hi Radu,<div><br></div><div>Unfortunately I have the time only to use it, \
but not test it :) I understand everyone in the xmlbeans is equally busy with other \
tasks. Hence I have moved to JAXB for now and that works without any problems. \
</div><div><br></div><div>I feel though xmlbeans is a great product defects like \
these and its inability to give pure value objects [it is now tied to xmlobject] \
might prove to be its undoing. Modern architectures require such abilities. \
application/xml - REST requests require this parsing to work \
seamlessly.</div><div><br></div><div>Thanks,</div><div>Suire.<br><br>--- On <b>Mon, \
6/8/09, Radu Preotiuc-Pietro <i>&lt;radu.preotiuc-pietro@oracle.com></i></b> \
wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: \
5px; padding-left: 5px;"><br>From: Radu Preotiuc-Pietro  \
&lt;radu.preotiuc-pietro@oracle.com><br>Subject: RE: xmlobject stream closure upon \
parse affecting httpservletrequest application/xml<br>To: \
dev@xmlbeans.apache.org<br>Date: Monday, June 8, 2009, 7:25 PM<br><br><div \
id="yiv972059224">

 
 
 
<div dir="ltr" align="left"><span class="718012419-08062009"><font face="Arial" \
color="#0000ff" size="2">So it must be something else then, it was worth checking...  \
Try the parser change.</font></span></div> <div dir="ltr" align="left"><span \
class="718012419-08062009"><font face="Arial" color="#0000ff" size="2"></font></span> \
</div> <div dir="ltr" align="left"><span class="718012419-08062009"><font \
face="Arial" color="#0000ff" size="2">Radu</font></span></div><br> <blockquote \
style="PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#0000ff 2px \
solid;MARGIN-RIGHT:0px;">  <div class="OutlookMessageHeader" lang="en-us" dir="ltr" \
align="left">  <hr tabindex="-1">
  <font face="Tahoma" size="2"><b>From:</b> Suire Rekv [mailto:suirerekv@yahoo.com] 
  <br><b>Sent:</b> Friday, June 05, 2009 7:01 PM<br><b>To:</b> 
  dev@xmlbeans.apache.org<br><b>Subject:</b> RE: xmlobject stream closure upon 
  parse affecting httpservletrequest application/xml<br></font><br></div>
  <div></div>
  <table cellspacing="0" cellpadding="0" border="0">
    <tbody>
    <tr>
      <td valign="top">Hi Radu,<br><br>I'm running xmlbeans-2.4.0.jar - seems to 
        be the latest and it still has the 
        problem.<br><br>Regards,<br>Suire.<br><br>--- On <b>Fri, 6/5/09, Radu 
        Preotiuc-Pietro <i>&lt;radu.preotiuc-pietro@oracle.com></i></b> 
        wrote:<br>
        <blockquote style="PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:rgb(16,16,255) \
2px solid;"><br>From:   Radu Preotiuc-Pietro 
          &lt;radu.preotiuc-pietro@oracle.com><br>Subject: RE: xmlobject 
          stream closure upon parse affecting httpservletrequest 
          application/xml<br>To: dev@xmlbeans.apache.org<br>Date: Friday, June 
          5, 2009, 6:19 PM<br><br>
          <div id="yiv1179123479">
          <div dir="ltr" align="left"><span class="921221718-05062009"><font \
face="Arial" color="#0000ff" size="2">I would try the Java default   \
                one.</font></span></div>
          <div dir="ltr" align="left"><span class="921221718-05062009"><font \
                face="Arial" color="#0000ff" size="2"></font></span> </div>
          <div dir="ltr" align="left"><span class="921221718-05062009"><font \
                face="Arial" color="#0000ff" size="2">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.</font></span></div>
          <div dir="ltr" align="left"><span class="921221718-05062009"><font \
                face="Arial" color="#0000ff" size="2"></font></span> </div>
          <div dir="ltr" align="left"><span class="921221718-05062009"><font \
                face="Arial" color="#0000ff" size="2">Radu</font></span></div><br>
          <blockquote \
style="PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:rgb(0,0,255) 2px \
                solid;MARGIN-RIGHT:0px;">
            <div class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left">
            <hr tabindex="-1">
            <font face="Tahoma" size="2"><b>From:</b> Suire Rekv 
            [mailto:suirerekv@yahoo.com] <br><b>Sent:</b> Thursday, June 04, 
            2009 7:20 PM<br><b>To:</b> 
            dev@xmlbeans.apache.org<br><b>Subject:</b> Re: xmlobject stream 
            closure upon parse affecting httpservletrequest 
            application/xml<br></font><br></div>
            <div></div>
            <table cellspacing="0" cellpadding="0" border="0">
              <tbody>
              <tr>
                <td valign="top">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.<br><br>I 
                  can try setting the xmloptions. Which parser do you 
                  suggest.?<br><br>Also can you tell me if the parse method of 
                  xmlbeans closes the stream?<br>The wierd thing is that the 
                  first request works, the second maybe, the third or fourth 
                  fails.<br>But once the failure happens, alternate requests 
                  fail consistently, unless tomcat is restarted.<br><br>- 
                  Suire.<br><br>--- On <b>Thu, 6/4/09, Radu Preotiuc 
                  <i>&lt;radu.preotiuc-pietro@oracle.com></i></b> wrote:<br>
                  <blockquote \
style="PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:rgb(16,16,255) 2px \
solid;"><br>From:   Radu Preotiuc 
                    &lt;radu.preotiuc-pietro@oracle.com><br>Subject: Re: 
                    xmlobject stream closure upon parse affecting 
                    httpservletrequest application/xml<br>To: 
                    dev@xmlbeans.apache.org<br>Date: Thursday, June 4, 2009, 
                    6:17 PM<br><br>
                    <div class="plainMail">What makes you think this is not a 
                    problem with the container in the way<br>it handles the 
                    stream?<br><br>With XMLBeans, you can usually change the 
                    parser with<br>XmlOptions.setLoadUseXMLReader(). If you 
                    change the parser and the<br>problem persists, that would be 
                    a strong indication that the problem is<br>in the 
                    container.<br><br>Radu<br><br>On Sat, 2009-05-30 at 11:54 
                    -0700, Suire Rekv wrote:<br>> Hi,<br>> <br>> When I 
                    use XmlObject.Factory.parse(InputStream is) to read the 
                    request<br>> object's InputStream for request type 
                    application/xml I sporadically<br>> get errors as 
                    attempting to read from a closed stream. This 
                    problem<br>> happens directly when I read it from a 
                    spring controller or via cxf.<br>> <br>> To fix this I 
                    had to parse the inputstream to a string and then<br>> 
                    construct the xmlobject from the string. By default the cxf 
                    xmlbeans<br>> provider reads the stream directly and 
                    cannot be used as such.<br>> <br>> To test 
                    this:<br>> <br>> public ModelAndView 
                    handleRequest(HttpServletRequest request,<br>> 
                    HttpServletResponse response)<br>>  
                       throws ServletException, IOException, 
                    Exception {<br>>            
                      
                    XmlObject.Factor.parse(request.getInputStream());  
                         <br>> }<br>> <br>> Try 
                    hitting the webpage multiple times and you will the 
                    exception.<br>> <br>> Any suggestions?<br>> 
                    <br>> Thanks,<br>> Suire.<br>> <br>> 
                    <br><br><br>---------------------------------------------------------------------<br>To \
                
                    unsubscribe, e-mail: <a \
rel="nofollow">dev-unsubscribe@xmlbeans.apache.org</a><br>For   additional commands, \
e-mail: <a rel="nofollow">dev-help@xmlbeans.apache.org</a><br><br></div></blockquote>< \
/td></tr></tbody></table><br></blockquote></div></blockquote></td></tr></tbody></table><br></blockquote> \
 </div></blockquote></div></td></tr></table><br>

      



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic