[Dev] [DSS][ESB] Querying the cached response
Hi there, I have a Oracle database view containing details of around 8000 employees. I need to populate employee search suggestions from that view. I'm planning to use DSS/ DSS+ESB to create a data service for that. Rather querying the view for each and every service call, i'm thinking of caching the whole view in DSS/ESB and query the cache for all the filter queries("like", "where" queries) until cache expires. Is there any possibilities around ESB/DSS related to the above scenario? -- Thanks *Yasas Karunarathna* yasasblog.wordpress.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [DSS][AXIS2][AXIS2-JSON] Writing a new XML to JSON conversion
l.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) > at > org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214) > at > org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433) > at > org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81) > at > org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60) > at > org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40) > at > org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38) > at > org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1267) > at > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1186) > at > org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1081) > at > org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027) > at > org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314) > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > at > org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) > at > org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) > at java.lang.Thread.run(Thread.java:662) > Caused by: org.apache.axis2.deployment.DeploymentException: > org/apache/axis2/json/JSONMMyFormatter > at > org.apache.axis2.deployment.AxisConfigBuilder.processMessageBuilders(AxisConfigBuilder.java:775) > at > org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:236) > at > org.wso2.carbon.core.CarbonAxisConfigurator.populateAxisConfiguration(CarbonAxisConfigurator.java:308) > at > org.wso2.carbon.core.CarbonAxisConfigurator.getAxisConfiguration(CarbonAxisConfigurator.java:188) > ... 42 more > Caused by: java.lang.NoClassDefFoundError: > org/apache/axis2/json/JSONMMyFormatter > at > org.wso2.training.custom.json.JSONMyBuilder.(JSONMyBuilder.java:35) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at java.lang.Class.newInstance0(Class.java:357) > at java.lang.Class.newInstance(Class.java:310) > at > org.apache.axis2.deployment.DescriptionBuilder.processMessageBuilders(DescriptionBuilder.java:230) > at > org.apache.axis2.deployment.AxisConfigBuilder.processMessageBuilders(AxisConfigBuilder.java:772) > ... 45 more > Caused by: java.lang.ClassNotFoundException: > org.apache.axis2.json.JSONMMyFormatter > at > org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:455) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) > at > org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) > at > org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) > at java.lang.ClassLoader.loadClass(ClassLoader.java:247) > ... 54 more > > > Thanks, > > > On Mon, Jul 14, 2014 at 3:17 PM, Shameera Rathnayaka > wrote: > >> Hi Rajith, >> >> Why are you asking him to build the patches , can't he work on already >> released DSs pack, Here i am trying to understand which issue Yasas trying >> to address by implementing a new JSON builder and formatter, we have plenty >> of Builders and formatters for JSON :) . May i know the real use case and >> requirement ? >> >> Thanks, >> Shameera >> >> >> On Mon, Jul 14, 2014 at 2:51 PM, Rajith Vitharana >> wrote: >> >>> 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 >>> &quo
Re: [Dev] [DSS][AXIS2][AXIS2-JSON] Writing a new XML to JSON conversion
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 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 > /repository/components/lib ( or > /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 > 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 >> 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 >>> >> >>> class="org.apache.axis2.json.newJSONMessageFormatter"/> >>> >>> >> class="org.apache.axis2.json.newJSONOMBuilder"/> >>> Can anybody advice me on achieving the above requirements? >>> >>> -- >>> >>> Thanks >>> >>> >>> >>> *Yasas Karunarathna* >>>
[Dev] [DSS][AXIS2][AXIS2-JSON] Writing a new XML to JSON conversion
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 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