XPages: can someone shed some light on these messa

2019-09-16 02:04发布

问题:

15/07/15 11:04: Exception Thrown
Context Path: /aalto803.nsf
Page Name: /Preferences.xsp
javax.faces.FacesException
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:102)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
    at com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:256)
    at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:228)
    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 javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:317)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:428)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:94)
    ... 19 more

We're in the process of finding memory leaks, so we can add the necessarye recycle() statements. What we do is this: we open a document in our application, save and close it, and that multiple times. We can see that memory usage stabilizes after a few times, in most cases, which seems a good sign. But every now and then, after some 10 repeats or so, the application stops, with the message above (NullPointerException), or with NoAccessSignal.

No clue as to where to start looking... Any ideas??

Just in case someone wonders why we don't use OpenNTF library: the application has to run on an R8.5 Domino server.

回答1:

I would check that you don't recycle any database objects. Also add multiple try{}catch() statements in your code with print so you can find where the code crashes to narrow down the problem.

Also you could check how you state and application / session timeout is configured http://www.dalsgaard-data.eu/blog/tuning-your-xpages/



回答2:

The issue:

java.lang.NullPointerException
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:317)

is tracked as SPR#RGAU9UPLZ7.

It occurs when you have 2 concurrent requests to different XPage instances in the same session, and when the request threads interact in a specific manner (so it's usually intermittent). The problem is specific to when the "page persistence" option is "in memory" rather than "on disk" (as files).



回答3:

I've not seen that before. It's in Invoke Application phase of a partial refresh (first line of stack trace), so when your SSJS runs after e.g. a button click. The "caused by" bit points to NullPointerException in broadcastEvents, a core method of the XPages runtime. So it seems unconnected to your application logic, but something deeper.

Searching for "NullPointerException" and "broadcastEvents" I came across this technote https://www-304.ibm.com/support/entdocview.wss?uid=swg1LO84237. Admittedly it's for 9.0, but that doesn't mean the problem didn't exist in earlier releases under the same circumstances.

It doesn't sound related to memory leaks - it's not giving an out of memory error, but hitting a NullPointerException in broadcastEvents, line 317. IBM may be able to shed light on what's occurring on that line and why it might throw an NPE.