You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2012/11/14 16:54:14 UTC

[jira] [Commented] (AXIS2-5044) JSONMessageFormatter does not call startDocument on XMLWriter with Mapped convention

    [ https://issues.apache.org/jira/browse/AXIS2-5044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497173#comment-13497173 ] 

Hudson commented on AXIS2-5044:
-------------------------------

Integrated in axis2-1.6 #322 (See [https://builds.apache.org/job/axis2-1.6/322/])
    Merged a couple of fixes to the 1.6 branch to avoid 100% CPU usage triggered by certain JSON payloads:
* AXIS2-5044 (r1127327; prerequisite for the other fixes)
* AXIS2-5125 (r1243469, r1290999)
* AXIS2-5300 (r1332362, r1332402; requires Axiom 1.2.14) (Revision 1409218)

     Result = SUCCESS
veithen : 
Files : 
* /axis/axis2/java/core/branches/1_6
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONBadgerfishDataSource.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONBadgerfishMessageFormatter.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONBadgerfishOMBuilder.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONDataSource.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONMessageFormatter.java
* /axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java
* /axis/axis2/java/core/branches/1_6/modules/json/test/org/apache/axis2/json/JSONDataSourceTest.java
* /axis/axis2/java/core/branches/1_6/modules/json/test/org/apache/axis2/json/JSONOMBuilderTest.java
* /axis/axis2/java/core/branches/1_6/modules/parent/pom.xml
* /axis/axis2/java/core/branches/1_6/modules/saaj

                
> 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: json
>            Reporter: Jean Marc
>            Assignee: Andreas Veithen
>             Fix For: 1.7.0
>
>         Attachments: axis2.xml, JSONSearchModel.java
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators
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