Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java AsynchCallback上出现空指针异常_Java_Gwt_Google Maps Api 3_Nullpointerexception - Fatal编程技术网

Java AsynchCallback上出现空指针异常

Java AsynchCallback上出现空指针异常,java,gwt,google-maps-api-3,nullpointerexception,Java,Gwt,Google Maps Api 3,Nullpointerexception,这是我的方法 @Override public void onSuccess(PlotSetOutput result) { String test = result.toString(); // this works controller.getScolopaxGUI().getResultsPanel().setPlots(result); controller.getScolopaxGUI().displayTab(1); }

这是我的方法

@Override
public void onSuccess(PlotSetOutput result) {
            String test = result.toString(); // this works
        controller.getScolopaxGUI().getResultsPanel().setPlots(result);
        controller.getScolopaxGUI().displayTab(1);
    }
在我的setPlots方法中,我试图在谷歌地图上显示结果。我设置了一个断点 在setPlots内部,代码似乎在此之前失败了。 我也成功地获得了ResultPanel对象。因此,我很困惑是什么导致了这个NullPointerException

06:47:38.791 [ERROR] [scolopax] Uncaught exception escaped
java.lang.NullPointerException: null
    at edu.neu.scolopax.web.client.RetrieveSummariesAsynchCallback.onSuccess(RetrieveSummariesAsynchCallback.java:32)
    at edu.neu.scolopax.web.client.RetrieveSummariesAsynchCallback.onSuccess(RetrieveSummariesAsynchCallback.java:1)
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
    at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:258)
    at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
    at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:680)
这里

以下其中一项为null

controller

controller.getScolopaxGUI()    

controller.getScolopaxGUI().getResultsPanel()
试试这个

    if(controller != null &&  controller.getScolopaxGUI() != null && 
 controller.getScolopaxGUI().getResultsPanel() != null)
     controller.getScolopaxGUI().getResultsPanel().setPlots(result);

这里的第32行是什么?我调用set plots方法的那一行。controller.getScolopaxGUI().getResultsPanel().setPlots(结果)@Yeshwanth Venkatesh你会来的