Hi Rajkumar,

I have tried out your scenario. AFAIU this happens when your rest response
is empty. Empty response throws this exception. You can see that your
response is empty or not by changing the rest end point and print or
logging the final response which is sent back to the jaggery application.

Thanks,


On Sun, Aug 24, 2014 at 6:53 PM, Rajkumar Rajaratnam <rajkum...@wso2.com>
wrote:

> Hi,
>
> I am calling post method from a jaggery app.
>
> var response = post(endpoint,data,headers, 'json');
>
> This is calling the following REST API.
>
>  @POST  @Path("/policy/deployment/partition")  @Produces(
> "application/json")  @Consumes("application/json")  @AuthorizationAction(
> "/permission/protected/manage/monitor/tenants")  @SuperTenantService(true)
> public Response deployPartition (Partition partition)  throws
> RestAPIException {   ServiceUtils.deployPartition(partition);  URI url =
> uriInfo.getAbsolutePathBuilder().path(partition.id).build();  return
> Response.created(url).build();  }
>
> *REST API is executed and returning successfully. As soon as jaggery app
> is getting the response, it is throwing the following error.*
>
>
> TID: [0] [STRATOS] [2014-08-24 12:22:46,509] ERROR
> {org.jaggeryjs.jaggery.core.manager.WebAppManager} -
>  org.mozilla.javascript.WrappedException: Wrapped
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NullPointerException (http#17)
> (/console/controllers/router.jag#119)
> {org.jaggeryjs.jaggery.core.manager.WebAppManager}
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.WrappedException: Wrapped
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NullPointerException (http#17)
> (/console/controllers/router.jag#119)
>  at
> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:571)
> at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
>  at
> org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:447)
> 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:1110)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: org.mozilla.javascript.WrappedException: Wrapped
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NullPointerException (http#17)
> (/console/controllers/router.jag#119)
>  at
> org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
>  at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
> at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
>  at
> org.jaggeryjs.rhino.console.controllers.c0._c_anonymous_1(/console/controllers/router.jag:119)
> at
> org.jaggeryjs.rhino.console.controllers.c0.call(/console/controllers/router.jag)
>  at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
> at
> org.jaggeryjs.rhino.console.controllers.c0._c_script_0(/console/controllers/router.jag:23)
>  at
> org.jaggeryjs.rhino.console.controllers.c0.call(/console/controllers/router.jag)
> at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
>  at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
> at
> org.jaggeryjs.rhino.console.controllers.c0.call(/console/controllers/router.jag)
>  at
> org.jaggeryjs.rhino.console.controllers.c0.exec(/console/controllers/router.jag)
> at
> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
>  ... 35 more
> Caused by: org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NullPointerException (http#17)
>  at
> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:571)
> at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
>  at
> org.jaggeryjs.jaggery.core.manager.WebAppManager.executeScript(WebAppManager.java:273)
> at
> org.jaggeryjs.jaggery.core.manager.WebAppManager.include(WebAppManager.java:127)
>  at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:601)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
>  ... 47 more
> Caused by: org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NullPointerException (http#17)
> at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
>  at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
> at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
>  at
> org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
> at org.mozilla.javascript.gen.http_1._c_anonymous_2(http:17)
>  at org.mozilla.javascript.gen.http_1.call(http)
> at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
>  at org.mozilla.javascript.gen.http_1._c_anonymous_5(http:221)
> at org.mozilla.javascript.gen.http_1.call(http)
>  at
> org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
> at org.mozilla.javascript.gen.http_1._c_anonymous_8(http:232)
>  at org.mozilla.javascript.gen.http_1.call(http)
> at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
>  at
> org.jaggeryjs.rhino.console.util.c1._c_anonymous_47(/console/util/utility.jag:375)
> at org.jaggeryjs.rhino.console.util.c1.call(/console/util/utility.jag)
>  at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
> at
> org.jaggeryjs.rhino.console.util.c1._c_anonymous_18(/console/util/utility.jag:149)
>  at org.jaggeryjs.rhino.console.util.c1.call(/console/util/utility.jag)
> at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
>  at
> org.jaggeryjs.rhino.console.controllers.c4._c_anonymous_1(/console/controllers/wizardSubmit.jag:38)
> at
> org.jaggeryjs.rhino.console.controllers.c4.call(/console/controllers/wizardSubmit.jag)
>  at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
> at
> org.jaggeryjs.rhino.console.controllers.c4._c_script_0(/console/controllers/wizardSubmit.jag:22)
>  at
> org.jaggeryjs.rhino.console.controllers.c4.call(/console/controllers/wizardSubmit.jag)
> at
> org.jaggeryjs.rhino.console.controllers.c4.exec(/console/controllers/wizardSubmit.jag)
>  at
> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
> ... 54 more
> Caused by: java.lang.NullPointerException
>  at
> org.jaggeryjs.scriptengine.util.HostObjectUtil.invalidArgsError(HostObjectUtil.java:41)
> at
> org.jaggeryjs.scriptengine.engine.RhinoTopLevel.parse(RhinoTopLevel.java:48)
>  at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:601)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
>  ... 78 more
>
> What would be the issue here?
>
> Thanks
>
> _______________________________________________
> 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

Reply via email to