glassfish
  1. glassfish
  2. GLASSFISH-19340

[PERF] NullPointerException in StatefulSessionContainer.forceDestroyBean

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b62_ms6
    • Fix Version/s: 4.0_b89_RC5
    • Component/s: ejb_container
    • Labels:
      None

      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.]

        Activity

        Hide
        Scott Oaks added a comment -

        Fixed in latest builds.

        Show
        Scott Oaks added a comment - Fixed in latest builds.
        Hide
        marina vatkina added a comment -

        Assigning back to Scott to verify on the latest build

        Show
        marina vatkina added a comment - Assigning back to Scott to verify on the latest build
        Hide
        marina vatkina added a comment -

        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.

        Show
        marina vatkina added a comment - 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.

          People

          • Assignee:
            Scott Oaks
            Reporter:
            Scott Oaks
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: