NullpointerException Please Help

sscilli's picture
Hello, I have the following function: function recuperaDati(myurl,suffix,endPoint,operation){ var request = new WSRequest(); var options = new Array(); var payload = null; var response = null; request.openWSDL(myurl+"/"+suffix+"/"+endPoint+"?wsdl",false); request.send(operation,payload); response = request.resposeXML; return response; } And it works, but when called it returns a null pointer exception. I tested the dataservice called with the tryIT function form the web interface and it works fine. It seems that if you use null for the payload you get the exception, but if you use a void string the server claims that you haven't passed a parameter. Here is the stack trace: org.wso2.mashup.MashupFault: java.lang.NullPointerException at org.wso2.mashup.hostobjects.wsrequest.WSRequestHostImpl.jsFunction_send(WSRequestHostImpl.java:799) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:411) at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76) at org.mozilla.javascript.gen.c255._c1(c102217-CAMMash:25) at org.mozilla.javascript.gen.c255.call(c102217-CAMMash) at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97) at org.mozilla.javascript.gen.c255._c2(c102217-CAMMash:34) at org.mozilla.javascript.gen.c255.call(c102217-CAMMash) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834) at org.mozilla.javascript.gen.c255.call(c102217-CAMMash) at org.wso2.javascript.rhino.JavaScriptEngine.call(JavaScriptEngine.java:180) at org.wso2.javascript.rhino.JavaScriptEngine.call(JavaScriptEngine.java:210) at org.wso2.javascript.rhino.JavaScriptReceiver.invokeBusinessLogic(JavaScriptReceiver.java:195) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:131) at org.wso2.mashup.transport.MashupServlet.doPost(MashupServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.wso2.mashup.transport.ServiceUIFilter.doFilter(ServiceUIFilter.java:207) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.wso2.adminui.AdminUIServletFilter.doFilter(AdminUIServletFilter.java:135) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.axis2.AxisFault: java.lang.NullPointerException at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548) at org.wso2.mashup.hostobjects.wsrequest.WSRequestHostImpl.jsFunction_send(WSRequestHostImpl.java:772) ... 46 more
keith's picture

Cou

Hi, Could you post your dbs file please. Or even the WSDL of the dataService so that I can try to reproduce the scenario and figure out what is wrong. Thanks, Keith. Blog: http://www.keith-chapman.org/
sscilli's picture

Hello, I solved using E4X

Hello, I solved using E4X stubs ;-)
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)