cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Potential bug with JAX RS XMLSource
Date Sat, 07 Aug 2010 12:44:36 GMT
Hi

On Fri, Aug 6, 2010 at 7:04 PM, Albert <albert.mendonca@clearwire.com>wrote:

>
> Hi.
>
> I'm using CXF 2.2.9
>
> My JAX RS service method accepts XMLSource as the input type and i used
> xpath expressions on it.
>
> The first parse works fine. The second doesn't. I reversed the order and
> the
> result is the same. I looked up your source, and it fails at this location
>
>  return xpath.evaluate(expression, getSource(), type); [XMLSource, #173]
>
> with exception
>
> </pre></p><p>root cause <pre>java.lang.IllegalArgumentException:
Illegal
> XPath expression '/usercredentials/username'
>
> and the root cause as
>
> </pre></p><p>root cause <pre>org.xml.sax.SAXParseException: Premature
end
> of
> file.
>
>
When working with  XMLSource explicitly, one can do setBuffering(true) on it
which will allow for multiple evaluations. In this case though it is not set
(SourceProvider deals with it at the moment). You can probably do
setBuffering(true) right inside the method or alternatively create a custom
provider

cheers, Sergey


> I looked up the internet, and from one of the posts, it could be because
> the
> InputStream is already closed after the first parse.
>
>
> http://www.danielschneller.com/2008/01/saxparseexception-1-1-premature-end-of.html
>
> Please take a look.
>
> Thank you.
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Potential-bug-with-JAX-RS-XMLSource-tp2266922p2266922.html
> Sent from the cxf-issues mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message