Hi
On 02/10/12 12:45, Sergey Beryozkin wrote:
Hi
On 02/10/12 01:04, SK wrote:
Hello,
We are using CXF for REST and Jettison 1.3.2. For a JSON request when
SAXParseException is thrown the column and line are incorrect in the
exception. The line is always -1 and the column is 0. Note, this is
not the case for the same request is XML. Is there any way to get the
line/column detail JSON requests when the reader/unmarshaller
encounters an unknown element? Thanks!
I'm not sure that SAXParserException should even be exposed in such
cases given that SAXParserException is XML centric exception, I guess it
does escape from the parsing layer.
I think that the issue is that Jettison does not correctly implement
some of the relevant reader methods. Perhaps it is possible to tweak it
for a 'column' in the exception to point to the actual character in the
JSON sequence which caused an error. I'll have a look later when I start
working on the next Jettison release
An absolute column number will be reported started from Jettison 1.3.3
(this will be available in the original JSONException and
XMLStreamException Location object at the CXF level, with
XMLStreamException being wrapped within WebApplicationException)
Calculating the line is more sensitive, will get it fixed sometime
later, Jettison patch will also be welcome
Cheers, Sergey
- Steve
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com