Intermittent NullPointerException with xe:dialog

240 Views Asked by At

I've used the xe:dialog in many apps before just fine, but am having problems with a new XPage workflow form that has several buttons which call xe:dialog prompts.

As I test this with several browsers, with different logins to simulate an initiator and approvers, the buttons works fine. Then after a while, clicking one of these same buttons causes "Unexpected runtime error: The runtime has encountered an unexpected error. java.lang.NullPointerException" -- from this point on, no user can click any of the buttons which use xe:dialog - they get the same error. It is so messed up on the server that I have to restart HTTP or the whole server to get them working again.

During the workflow, the app sends emails with a link back to the XPage. It seems like the problem occurs most frequently after the app has been opened with a link from an email (and the user has logged in).

So, some object is not being set properly. How can I identify which object is not set?

Here's the trace

11/21/14 8:28 AM: Exception Thrown
Context Path: /aaa.nsf
Page Name: /test.xsp
javax.faces.FacesException: java.lang.NullPointerException
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:865)
at com.ibm.xsp.extlib.component.dynamiccontent.UIDynamicControl.invokeOnComponent(UIDynamicControl.java:254)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.extlib.component.dialog.UIDialog.invokeOnComponent(UIDialog.java:543)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.component.UIDataPanelBase.invokeOnComponent(UIDataPanelBase.java:416)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.component.UIDataPanelBase.invokeOnComponent(UIDataPanelBase.java:416)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.component.UIDataPanelBase.invokeOnComponent(UIDataPanelBase.java:416)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.component.UIDataPanelBase.invokeOnComponent(UIDataPanelBase.java:416)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.component.UIDataPanelBase.invokeOnComponent(UIDataPanelBase.java:416)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.component.UIDataPanelBase.invokeOnComponent(UIDataPanelBase.java:416)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:878)
at com.ibm.xsp.component.UIViewRootEx.invokeOnComponent(UIViewRootEx.java:1552)
at com.ibm.xsp.component.UIViewRootEx._invokePartialRefresh(UIViewRootEx.java:1323)
at com.ibm.xsp.component.UIViewRootEx2._invokePartialRefresh(UIViewRootEx2.java:132)
at com.ibm.xsp.component.UIViewRootEx._renderView(UIViewRootEx.java:1309)
at com.ibm.xsp.component.UIViewRootEx.renderView(UIViewRootEx.java:1255)
at com.ibm.xsp.application.ViewHandlerExImpl.doRender(ViewHandlerExImpl.java:651)
at com.ibm.xsp.application.ViewHandlerExImpl._renderView(ViewHandlerExImpl.java:321)
at com.ibm.xsp.application.ViewHandlerExImpl.renderView(ViewHandlerExImpl.java:336)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:103)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
at com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:270)
at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:224)
at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)
at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Caused by: java.lang.NullPointerException
at com.ibm.xsp.extlib.component.dynamiccontent.AbstractDynamicContent.createContent(AbstractDynamicContent.java:134)
at com.ibm.xsp.extlib.component.dialog.UIDialog$PopupContent.encodeBegin(UIDialog.java:224)
at com.ibm.xsp.util.FacesUtil.renderComponent(FacesUtil.java:842)
at com.ibm.xsp.component.UIViewRootEx$1.invokeContextCallback(UIViewRootEx.java:1326)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:862)
... 46 more
2

There are 2 best solutions below

0
On BEST ANSWER

This has been a tough one to troubleshoot because of the intermittent nature of the errors and vague error message text. I do not have a definitive answer, but it now appears to be working consistently without error after making two changes - so, I am documenting them so that it may possibly help point someone else towards a solution if they are getting NullPointerException related to xe:dialog.

First, I narrowed the error to occurring ONLY after opening the web app from a link sent in a notification email from the app: the link url included "&action=openDocument" but needed to have "&action=editDocument" because the dialog has editable fields.

The second change was that the app had been getting data from a database that the user did not have ACL rights to access by using sessionAsSigner. I've changed the ACL to allow the user access and changed the code from using sessionAsSigner to session.

1
On

I wonder if the dialogbox is sitting inside a panel then in some conditions is not being rendered. Remember you can't open something that doesn't exist. Since you've used dialog boxes before and it looks like you're using dynamicContent... that we be my first guess as to the problem.