I have an invocation target exception issue. I am having one object(window) which i am calling on a click of a button, now using that common button on two different User Interfaces. The problem is that when i click on it on one UI it shows me the data but when i click it on other UI it returns invocation target exception.
Code is:
@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);
}
Stack Trace:
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
The compiler moves to this:
/**
* Constructs a InvocationTargetException with a target exception.
*
* @param target the target exception
*/
public InvocationTargetException(Throwable target) {
super((Throwable)null); // Disallow initCause
this.target = target;
}