Hi, I have the fixed the issue with Axis2 json message formatter with r180584. The axis2-json tests are passing fine, and the Json sample is working fine too after the change.
The issue was that with Jettison MappedXMLStreamWriter, we always need to call XMLStreamWriter#writeStartDocument before serializing the xml elements to json via XMLStreamWriter#writeStartElement. Created JIRA [1] [1] https://wso2.org/jira/browse/CARBON-14352 Thanks, KasunG On Fri, Aug 9, 2013 at 9:14 PM, Supun Malinga <sup...@wso2.com> wrote: > Hi Kasun, > > Seems axis2 Json sample also fails due to this. See the jira, > https://wso2.org/jira/browse/WSAS-1456 > > thanks, > > > On Thu, Aug 8, 2013 at 1:46 PM, Kasun Gajasinghe <kas...@wso2.com> wrote: > >> >> Two tests are failing in Axis2 Json module with NPE both of which >> happened in method MappedXMLStreamWriter#writeEndElement. Any ideas on how >> to fix this? >> >> testEchoOMWithJSON(org.apache.axis2.json.JSONIntegrationTest) Time >> elapsed: 0.028 sec <<< ERROR! >> java.lang.NullPointerException: null >> at >> org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeEndElement(MappedXMLStreamWriter.java:252) >> at >> org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeEndElement(MTOMXMLStreamWriter.java:171) >> at >> org.apache.axiom.om.impl.util.OMSerializerUtil.serializeEndpart(OMSerializerUtil.java:58) >> at >> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:876) >> at >> org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:125) >> at >> org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:117) >> at >> org.apache.axis2.json.AbstractJSONMessageFormatter.serializeChildren(AbstractJSONMessageFormatter.java:317) >> at >> org.apache.axis2.json.AbstractJSONMessageFormatter.writeTo(AbstractJSONMessageFormatter.java:193) >> at >> org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84) >> at >> org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499) >> at >> org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114) >> at >> org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096) >> at >> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) >> at >> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) >> at >> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) >> at >> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:622) >> at >> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193) >> at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) >> at >> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451) >> at >> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278) >> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442) >> at >> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:398) >> at >> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224) >> at >> org.apache.axis2.client.OperationClient.execute(OperationClient.java:149) >> at >> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554) >> at >> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530) >> at >> org.apache.axis2.json.JSONIntegrationTest.doEchoOM(JSONIntegrationTest.java:117) >> at >> org.apache.axis2.json.JSONIntegrationTest.testEchoOMWithJSON(JSONIntegrationTest.java:128) >> >> >> >> On Thu, Aug 8, 2013 at 1:33 PM, Kasun Gajasinghe <kas...@wso2.com> wrote: >> >>> Hi Miyuru, >>> >>> I did not test this with Axis2 JSON module. I will do it now, and update >>> here. >>> >>> There are API changes between these two versions. Notably in >>> AbstractXMLStreamWriter class. See the attached screenshots for api method >>> changes. >>> >>> Thanks, >>> KasunG >>> >>> >>> On Thu, Aug 8, 2013 at 1:22 PM, Miyuru Wanninayaka <miy...@wso2.com>wrote: >>> >>>> Axis2 JSON module too using jettison [1]. Did you tested that with >>>> jettison 1.3.4? >>>> I have tried to use axis2 json formatter with jettison 1.3.4 in >>>> repo/comp/libs and it trowed a NPE. We might need code change if there is >>>> any API change. >>>> >>>> Anyway we need to upgrade to latest jettison as 1.1.0 has a bug which >>>> fails to convert deeply nested large xml. >>>> >>>> [1] >>>> https://svn.wso2.org/repos/wso2/carbon/kernel/trunk/dependencies/axis2/1.6.1-wso2v10/modules/json/ >>>> >>>> >>>> On Thu, Aug 8, 2013 at 12:46 PM, Kasun Gajasinghe <kas...@wso2.com>wrote: >>>> >>>>> Thanks Nuwan.. >>>>> >>>>> Regards.. >>>>> >>>>> >>>>> On Thu, Aug 8, 2013 at 6:52 AM, Nuwan Bandara <nu...@wso2.com> wrote: >>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Thu, Aug 8, 2013 at 12:46 AM, Kasun Gajasinghe <kas...@wso2.com>wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> We need to $subject since CXF requires Jettison 1.3.4 to function >>>>>>> properly. [1] As I see, Synapse core uses Jettison, and as I see, >>>>>>> Synapse >>>>>>> core successfully passed with tests. I haven't committed the fixes to >>>>>>> there >>>>>>> yet. I can go ahead and commit if it's OK to upgrade. >>>>>>> >>>>>>> Jaggery team, can you please apply this pull request to upgrade >>>>>>> Jettison version there. [2] All Jaggery tests are passing successfully >>>>>>> after this change as well. I already upgraded Jettison version in >>>>>>> Mashup. >>>>>>> >>>>>> >>>>>> Done, >>>>>> >>>>>> Thanks, >>>>>> /Nuwan >>>>>> >>>>>> >>>>>>> >>>>>>> [1] https://wso2.org/jira/browse/WSAS-1433 >>>>>>> [2] https://github.com/wso2/jaggery/pull/43 >>>>>>> >>>>>>> Thanks, >>>>>>> KasunG >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> *Kasun Gajasinghe* >>>>>>> Software Engineer; >>>>>>> Development Technologies Team, WSO2 Inc.; http://wso2.com >>>>>>> >>>>>>> >>>>>>> , >>>>>>> *email: **kasung AT spamfree wso2.com >>>>>>> >>>>>>> >>>>>>> ** cell: **+94 (77) 678-0813* >>>>>>> *linked-in: *http://lk.linkedin.com/in/gajasinghe >>>>>>> >>>>>>> >>>>>>> * >>>>>>> * >>>>>>> *blog: **http://kasunbg.org* <http://kasunbg.org> >>>>>>> >>>>>>> >>>>>>> * >>>>>>> twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg> >>>>>>> >>>>>>> >>>>>>> * >>>>>>> * >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Dev mailing list >>>>>>> Dev@wso2.org >>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> *Thanks & Regards, >>>>>> >>>>>> Nuwan Bandara >>>>>> Technical Lead; **WSO2 Inc. * >>>>>> *lean . enterprise . middleware | http://wso2.com * >>>>>> *blog : http://nuwanbando.com; email: nu...@wso2.com; phone: +94 11 >>>>>> 763 9629 >>>>>> * >>>>>> <http://www.nuwanbando.com/> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> *Kasun Gajasinghe* >>>>> Software Engineer; >>>>> Development Technologies Team, WSO2 Inc.; http://wso2.com >>>>> >>>>> >>>>> , >>>>> *email: **kasung AT spamfree wso2.com >>>>> >>>>> >>>>> ** cell: **+94 (77) 678-0813* >>>>> *linked-in: *http://lk.linkedin.com/in/gajasinghe >>>>> >>>>> >>>>> * >>>>> * >>>>> *blog: **http://kasunbg.org* <http://kasunbg.org> >>>>> >>>>> >>>>> * >>>>> twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg> >>>>> >>>>> >>>>> * >>>>> * >>>>> >>>> >>>> >>>> >>>> -- >>>> Miyuru Wanninayaka >>>> Technical Lead >>>> WSO2 Inc. : http://wso2.com >>>> >>>> Mobile : +94 77 209 9788 >>>> Blog : http://miyurudw.blogspot.com >>>> Flickr : http://www.flickr.com/photos/miyuru_daminda >>> >>> >>> >>> >>> -- >>> *Kasun Gajasinghe* >>> Software Engineer; >>> Development Technologies Team, WSO2 Inc.; http://wso2.com >>> >>> >>> , >>> *email: **kasung AT spamfree wso2.com >>> >>> >>> ** cell: **+94 (77) 678-0813* >>> *linked-in: *http://lk.linkedin.com/in/gajasinghe >>> >>> >>> * >>> * >>> *blog: **http://kasunbg.org* <http://kasunbg.org> >>> >>> >>> * >>> twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg> >>> >>> >>> * >>> * >>> >> >> >> >> -- >> *Kasun Gajasinghe* >> Software Engineer; >> Development Technologies Team, WSO2 Inc.; http://wso2.com >> >> >> , >> *email: **kasung AT spamfree wso2.com >> >> >> ** cell: **+94 (77) 678-0813* >> *linked-in: *http://lk.linkedin.com/in/gajasinghe >> >> >> * >> * >> *blog: **http://kasunbg.org* <http://kasunbg.org> >> >> >> * >> twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg> >> >> >> * >> * >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Supun Malinga, > > Senior Software Engineer, > WSO2 Inc. > http://wso2.com > http://wso2.org > email - sup...@wso2.com <sup...@wso2.com> > mobile - 071 56 91 321 > -- *Kasun Gajasinghe* Software Engineer; Development Technologies Team, WSO2 Inc.; http://wso2.com , *email: **kasung AT spamfree wso2.com ** cell: **+94 (77) 678-0813* *linked-in: *http://lk.linkedin.com/in/gajasinghe * * *blog: **http://kasunbg.org* <http://kasunbg.org> * twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg> * *
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev