处理调用目标异常

时间:2016-07-27 10:00:29

标签: java vaadin

我有一个调用目标异常问题。我有一个对象(窗口),我点击一个按钮,现在使用两个不同的用户界面上的公共按钮。问题是,当我在一个UI上单击它时,它会向我显示数据,但是当我在其他UI上单击它时,它会返回调用目标异常。

代码是:

export const routes: RouterConfig = [
  { path: '*path', redirectTo:''},
];

堆栈追踪:

@Override
public void buttonClick(ClickEvent event) {

    // This if block will be called when user clicks on list of 
    // document button 
    if(event.getButton() == mlistButton) {
        try {
            listButtonButtonClicked();
        } catch (RequestDetailTableException | InvocationTargetException e) {
            e.printStackTrace();
        }
    }

    // this if block will be called when user clicks on Tracking button
    if(event.getButton() == mtrackingButton) {
        trackingButtonClicked();
    }

}

/**
 * This function will be called when user clicks on list of
 * document button.
 * @throws Exception 
 */
protected void listButtonButtonClicked() throws RequestDetailTableException {

    DocumentListLayout ldocumentList = null;
    try {
        ldocumentList = new DocumentListLayout(mrequestInfoBean,mdetailRequestLayout.getGeoAISUI());
    } catch (DocumentListLayoutException e) {
        throw new RequestDetailTableException(e);
    }
    mdetailRequestLayout.getGeoAISUI().addWindow(ldocumentList);
} 

编译器转移到此:

java.lang.NullPointerException
 at org.ids.geoais.common.RequestDetailTable.listButtonButtonClicked(RequestDetailTable.java:306)
 at org.ids.geoais.common.RequestDetailTable.buttonClick(RequestDetailTable.java:275)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
 at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)
 at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)
 at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:995)
 at com.vaadin.ui.Button.fireClick(Button.java:393)
 at com.vaadin.ui.Button$1.click(Button.java:61)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:158)
 at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
 at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:313)
 at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:202)
 at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:95)
 at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
 at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408)
 at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:350)
 at org.ids.geoais.Servlet.service(Servlet.java:160)
 at javax.servlet.http.HttpSer

0 个答案:

没有答案