[GLASSFISH-19340] [PERF] NullPointerException in StatefulSessionContainer.forceDestroyBean Created: 13/Nov/12  Updated: 16/May/13  Resolved: 16/May/13

Status: Closed
Project: glassfish
Component/s: ejb_container
Affects Version/s: 4.0_b62_ms6
Fix Version/s: 4.0_b89_RC5

Type: Bug Priority: Major
Reporter: Scott Oaks Assignee: Scott Oaks
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: PSRBUG

 Description   

Under load tests, calls to remove a stateful session bean sometimes throw this exception:

java.lang.NullPointerException
	at com.sun.ejb.containers.StatefulSessionContainer.forceDestroyBean(StatefulSessionContainer.java:1215)
	at com.sun.ejb.containers.StatefulSessionContainer.releaseContext(StatefulSessionContainer.java:1779)
	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2004)
	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1964)
	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
	at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
	at $Proxy151.remove(Unknown Source)
	at com.oracle.psr.PingServlet.doLocalSFSB(PingServlet.java:195)
	at com.oracle.psr.PingServlet.processRequest(PingServlet.java:93)
	at com.oracle.psr.PingServlet.doGet(PingServlet.java:151)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

I suspect this means that the app may be using the same stateful session bean in two threads at the same time, which means that the lookup of the bean returned the same bean to two different sessions. The basic servlet code is essentially this:

public void doGet(...) {
    InitialContext ic = new InitialContext();
    MyBean sfsb = ic.lookup(...);
    sfsb.cancel();   // cancel is annotated with @Remove
}

[Yes, we're not storing the sfsb for the session; it's a load test to look at the performance of the lookup and remove.]



 Comments   
Comment by marina vatkina [ 27/Mar/13 ]

Scott, can you rerun the test on the latest GF build? There had been a lot of changes and the line numbers don't match now.

Comment by marina vatkina [ 15/May/13 ]

Assigning back to Scott to verify on the latest build

Comment by Scott Oaks [ 16/May/13 ]

Fixed in latest builds.

Generated at Tue Mar 31 17:11:21 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.