axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AXIS2-5044) JSONMessageFormatter does not call startDocument on XMLWriter with Mapped convention
Date Tue, 17 May 2011 06:23:47 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-5044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andreas Veithen updated AXIS2-5044:
-----------------------------------

    Comment: was deleted

(was: 

rgds,
Ramesh nittur
sent from android device

Sent from Samsung mobile
)

> JSONMessageFormatter does not call startDocument on XMLWriter with  Mapped convention
> -------------------------------------------------------------------------------------
>
>                 Key: AXIS2-5044
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5044
>             Project: Axis2
>          Issue Type: Bug
>          Components: modules
>            Reporter: Jean Marc
>         Attachments: JSONSearchModel.java, axis2.xml
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When Mapped convention is used, JSONMessageFormatter creates an XMLStreamWriter from
Jettison library of type MappedXMLStreamWriter
> and executes the following code
>   XMLStreamWriter jsonWriter = getJSONWriter(bytesOut);
>   element.serializeAndConsume(jsonWriter);
>   jsonWriter.writeEndDocument();
> at 3 places in the class (in getBytes(), getTargetAddress() and writeTo() ).
> In the above code, there is no call to jsonWriter.writeStartDocument().
> This works for Jettison library v1.1 and below because of a refactoring of XMLStreamWriter
in Jettison v1.2 ( [invalid description of cause removed] ). 
>  
> Actually, the axis-json lib 1.5.4 specifies a Maven version dependency on Jettison 1.0
so it works, but with Jettison v1.2+
> a simple client trying to serialize a OMElement to send a soap message triggers a NPE
in Jettison when the last endElement() event is triggered
> because the call to startDocument has never been made.
> Simple solution is to add jsonWriter.writeStartDocument() before calling element.serializeAndConsume().

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message