Hi Ruchira,
When is registry.content() method i am getting following Exception.
ERROR {org.jaggeryjs.scriptengine.engine.RhinoEngine} -
org.mozilla.javascript.EcmaError: TypeError: Cannot find function content
in object org.wso2.carbon.registry.core.session.UserRegistry@10351989.
(/cloudmgt/modules/customurl/publish/publish.jag#165)
[2015-04-22 21:11:45,690] ERROR
{org.jaggeryjs.jaggery.core.manager.WebAppManager} -
org.mozilla.javascript.EcmaError: TypeError: Cannot find function content
in object org.wso2.carbon.registry.core.session.UserRegistry@10351989.
(/cloudmgt/modules/customurl/publish/publish.jag#165)
org.jaggeryjs.scriptengine.exceptions.ScriptException:
org.mozilla.javascript.EcmaError: TypeError: Cannot find function content
in object org.wso2.carbon.registry.core.session.UserRegistry@10351989.
(/cloudmgt/modules/customurl/publish/publish.jag#165)
I have attached full stacktrace of the error in this mail.
Thanks
On Wed, Apr 22, 2015 at 6:54 PM, Ruchira Wageesha <[email protected]> wrote:
> Hi Yashira,
>
> You can use registry.content() method. i.e.
>
> var content = registry.content(*'/_system/governances/file'*);
> *var *json = JSON.parse(content);
>
>
> On Wed, Apr 22, 2015 at 6:36 PM, Yashira Perera <[email protected]> wrote:
>
>> Hi all,
>>
>> I have implemented a jaggery program which used to take contents from the
>> Registry. but once i retrieve the content it was like [B@3fe7fd75 .(byte
>> format)
>>
>> The resource on registry is in json format and i used osgi
>> service(org.wso2.carbon.registry.core.service.RegistryService) to add and
>> retrieve the resource. My question is how to get the resource content as
>> json format?
>>
>> Thanks
>>
>> --
>> *Yashira Perera*
>> *Software Engineer *
>> *WSO2, Inc : * http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile: +9471 716 6797
>>
>
>
>
> --
>
> *Ruchira Wageesha**Associate Technical Lead*
> *WSO2 Inc. - lean . enterprise . middleware | wso2.com <http://wso2.com>*
>
> *email: [email protected] <[email protected]>, blog:
> ruchirawageesha.blogspot.com <http://ruchirawageesha.blogspot.com>,
> mobile: +94 77 5493444 <%2B94%2077%205493444>*
>
--
*Yashira Perera*
*Software Engineer *
*WSO2, Inc : * http://wso2.com
lean.enterprise.middleware
Mobile: +9471 716 6797
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:575)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432)
at
org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at
org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at
org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
at
org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
at
org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56)
at
org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
at
org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
at
org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at
org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot find function
content in object org.wso2.carbon.registry.core.session.UserRegistry@10351989.
(/cloudmgt/modules/customurl/publish/publish.jag#165)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665)
at
org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3693)
at
org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3712)
at
org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3783)
at
org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2269)
at
org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2251)
at
org.jaggeryjs.rhino.cloudmgt.modules.customurl.publish.c0._c_anonymous_3(/cloudmgt/modules/customurl/publish/publish.jag:165)
at
org.jaggeryjs.rhino.cloudmgt.modules.customurl.publish.c0.call(/cloudmgt/modules/customurl/publish/publish.jag)
at
org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
at
org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.cloudmgt.modules.customurl.c0._c_anonymous_2(/cloudmgt/modules/customurl/module.jag:8)
at
org.jaggeryjs.rhino.cloudmgt.modules.customurl.c0.call(/cloudmgt/modules/customurl/module.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.cloudmgt.site.blocks.customurl.ajax.c0._c_anonymous_1(/cloudmgt/site/blocks/customurl/ajax/customurl.jag:49)
at
org.jaggeryjs.rhino.cloudmgt.site.blocks.customurl.ajax.c0.call(/cloudmgt/site/blocks/customurl/ajax/customurl.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at
org.jaggeryjs.rhino.cloudmgt.site.blocks.customurl.ajax.c0._c_script_0(/cloudmgt/site/blocks/customurl/ajax/customurl.jag:5)
at
org.jaggeryjs.rhino.cloudmgt.site.blocks.customurl.ajax.c0.call(/cloudmgt/site/blocks/customurl/ajax/customurl.jag)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at
org.jaggeryjs.rhino.cloudmgt.site.blocks.customurl.ajax.c0.call(/cloudmgt/site/blocks/customurl/ajax/customurl.jag)
at
org.jaggeryjs.rhino.cloudmgt.site.blocks.customurl.ajax.c0.exec(/cloudmgt/site/blocks/customurl/ajax/customurl.jag)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:570)
... 35 more
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev