Hi Yasas, Try out creating a simple jar and put it in lib folder as shameera mentioned in above reply. I have tried out the scenario I have explained to you, and it worked fine for me As I mentioned, have you build the whole patch from the pom.xml inside patch0007 folder? and have you created "patch0008" folder and copied the jar(axis2-json-1.6.1-wso2v10.jar) inside "patch0007/dependencies/orbit/axis2-json/target" folder to the "patch0008" folder?
Thanks, On Mon, Jul 14, 2014 at 1:50 PM, Shameera Rathnayaka <shame...@wso2.com> wrote: > Hi Yasas, > > For you ClassNotFoundException, check do your axis2-json jar has required > classes, BTW as i mentioned in previous reply you don't need to do any code > changes to axis2 jars in order to plug your custom builders. > > Thanks, > Shameera. > > > On Mon, Jul 14, 2014 at 1:36 PM, Yasas Karunarathna <yasasm...@gmail.com> > wrote: > >> Thank you for the quick responses. I checked in sources from both the >> locations >> >> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/patches/patch0007/dependencies/axis2/modules/json/ >> >> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/dependencies/axis2/1.6.1-wso2v10/modules/json >> >> Separately build without any modifications, and put generated jar to >> patch8 folder. Once I restart the server following message shows in the >> console. >> >> "Could not start: >> null(reference:file:../plugins/axis2-json_1.6.1.wso2v10.jar:15). It's state >> is uninstalled." >> >> After that logs the following error. >> >> "Caused by: java.lang.ClassNotFoundException: >> org.apache.axis2.json.gson.JSONMessageHandler" >> >> Any work around? >> >> >> >> On Sun, Jul 13, 2014 at 11:30 PM, Shameera Rathnayaka <shame...@wso2.com> >> wrote: >> >>> Hi Yasas, >>> >>> Assuming you are going to customize the JSON mapped convention (Standard >>> Mapped Json support is their with Axis2),You don't need to do anything to >>> axis2 jar. Implement your new JSON builder and formatter, then create a >>> new jar(or osgi bundle) using those new classes >>> and copy that jar ( or osgi bundle) to >>> <DSS_HOME>/repository/components/lib ( or >>> <DSS_HOME>/repository/components/dropings) directory. Finally, you need to >>> configure your builder and formatter in axis2.xm configuration file (like >>> your 3rd step). >>> >>> Thanks, >>> Shameera. >>> >>> >>> >>> >>> On Sun, Jul 13, 2014 at 10:35 PM, Rajith Vitharana <raji...@wso2.com> >>> wrote: >>> >>>> Hi Yasas, >>>> >>>> The points you have mentioned are correct, but there are small changes >>>> I would like to point out. Below are the steps you'll need to follow to >>>> achieve your goal. >>>> >>>> 1 - There is a patch release for the "axis2-json" so you'll need to >>>> check out the source from [1] instead of the svn location you have >>>> mentioned. (checkout the whole "patch0007" instead of json module, so that >>>> it'll be easy for you to build the source.) >>>> 2 - Add the classes you need to the source. >>>> You'll need to extend AbstractJSONMessageFormatter in your >>>> custom formatter class >>>> You'll need to extend AbstractJSONOMBuilder in you custom >>>> builder class >>>> 3 - Build the whole patch0007. Then go to >>>> "patch0007/dependencies/orbit/axis2-json/target" folder where you can find >>>> the osgi bundle created from "axis2-json" module. >>>> 4 - Create "patch0008" folder inside >>>> "DSS_HOME/repository/components/patches" folder and copy the osgi bundle >>>> you found in step 3 to that folder. >>>> 5 - Add "messageFormatter" and "messageBuilder" elements to the >>>> "DSS_HOME/repository/conf/axis2/axis2.xml" as you have pointed out in your >>>> step 3. >>>> 6 - Restart the server and invoke your service adding "Accept" request >>>> header to the request with new content type you mentioned in "axis2.xml", >>>> example would be "Accept:application/json/newformat".(You can find >>>> sample of how to do it in [2]) >>>> >>>> [1] - >>>> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/patches/patch0007/dependencies/axis2/modules/json/ >>>> [2] - >>>> http://janakaranabahu.blogspot.com/2013/06/return-json-response-from-wso2-dss.html >>>> >>>> Thanks, >>>> >>>> >>>> On Sun, Jul 13, 2014 at 1:45 PM, Yasas Karunarathna < >>>> yasasm...@gmail.com> wrote: >>>> >>>>> Hi there, >>>>> >>>>> I want to do a small change to the json response returned from DSS >>>>> 3.2.1. I'm using JSONMessageFormatter & JSONOMBuilder in >>>>> org.apache.axis2.json package.(not gson implementations) >>>>> My requirements are as follows >>>>> >>>>> 1) Implement new JSONMessageFormatter, JSONOMBuilder etc. >>>>> And additional method accepting the Mapped json response and format >>>>> it accordingly, call it at the end of mapped json conversion. >>>>> 2) Build axis2-json-1.6.1-wso2v10.jar adding new classes. >>>>> I think this is the source used in DSS 3.2.1 : >>>>> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/dependencies/axis2/1.6.1-wso2v10/modules/json >>>>> >>>>> 3) State new Formatter and Builder in axis2.xml & call it with new >>>>> header >>>>> <messageFormatter contentType="application/json/newformat" >>>>> >>>>> class="org.apache.axis2.json.newJSONMessageFormatter"/> >>>>> >>>>> <messageBuilder contentType="application/json/newformat" >>>>> >>>>> class="org.apache.axis2.json.newJSONOMBuilder"/> >>>>> Can anybody advice me on achieving the above requirements? >>>>> >>>>> -- >>>>> >>>>> Thanks >>>>> >>>>> >>>>> >>>>> *Yasas Karunarathna* >>>>> yasasblog.wordpress.com >>>>> >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> Dev@wso2.org >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> Rajith Vitharana >>>> >>>> Software Engineer, >>>> WSO2 Inc. : wso2.com >>>> Mobile : +94715883223 >>>> Blog : http://lankavitharana.blogspot.com/ >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> Dev@wso2.org >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >>> >>> -- >>> *Software Engineer - WSO2 Inc.* >>> *email: shameera AT wso2.com <shame...@wso2.com> , shameera AT >>> apache.org <shame...@apache.org>* >>> *phone: +9471 922 1454 <%2B9471%20922%201454>* >>> >>> *Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561 >>> *Twitter : *https://twitter.com/Shameera_R >>> >> >> >> >> -- >> >> Thanks >> >> >> >> *Yasas Karunarathna* >> yasasblog.wordpress.com >> > > > > -- > *Software Engineer - WSO2 Inc.* > *email: shameera AT wso2.com <shame...@wso2.com> , shameera AT apache.org > <shame...@apache.org>* > *phone: +9471 922 1454 <%2B9471%20922%201454>* > > *Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561 > *Twitter : *https://twitter.com/Shameera_R > -- Rajith Vitharana Software Engineer, WSO2 Inc. : wso2.com Mobile : +94715883223 Blog : http://lankavitharana.blogspot.com/
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev