Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: IO
-
Labels:None
Description
While parsing [{attr:{id:1098, displayTitle:"fdgdg", active:false, mandatoryFlag:false, displayTag:1, validatorType:1}}] array with Jettison, exception is thown:
org.codehaus.jettison.json.JSONException: A JSONObject text must begin with '{' at character 1 of [{attr:{id:1098, displayTitle:"fdgdg", active:false, mandatoryFlag:false, displayTag:1, validatorType:1}}]
Jettison doesn't have such ability to parse root's arrays now. Just objects. From code sources of org.codehaus.jettison.mapped.MappedXMLInputFactory:
try
{ JSONObject root = new JSONObject(tokener); return new MappedXMLStreamReader(root, convention); }catch (JSONException e)
{ e.printStackTrace(); throw new XMLStreamException(e); }Will it possible in future to parse root's arrays? I mean is it bug or feature?
This is a limitation of Jettison. Since XStream is bound to this implementation for deserialization, you have to report it to the Jettison project and we will upgrade the dependency when it is fixed.