1 Reply Latest reply on Aug 6, 2004 5:07 PM by Scott Stark

    NullPointerException in AbstractTxInterceptorBMT of 3.2.5 on

    johnurban Newbie

      I created and called a stateful session bean successfully:

      try
      {
      Context ctx = getInitialContext();

      CMMaintSessionHome home = (CMMaintSessionHome) ctx.lookup("cmMaintSession.CMMaintSessionHome");
      CMMaintSession cmMaintSession = (CMMaintSession) home.create();

      User user = new User();

      user.setUserName(m_userId);
      user.setPassword(m_password);

      System.out.println("<<< CMMaintLoginDB.setUserInfo() - calling setUser on session bean...");
      cmMaintSession.setUser(user);

      // initialize session bean
      System.out.println("<<< CMMaintLoginDB.setUserInfo() - calling initialize on session bean...");
      cmMaintSession.initialize();

      System.out.println("<<< CMMaintLoginDB.setUserInfo() - storing handle to session bean in session tracking...");
      m_session.setAttribute("CMMaintSessionHandle", cmMaintSession.getHandle());
      m_session.setAttribute("userAuthenticated", "true");
      }
      catch (Exception e)
      {
      throw new JApplicationException(JApplicationException.NOPROCESS, e.getMessage());
      }


      After authentication to the DB, I then forward the request on to another jsp and eventually call the stateful session bean this way:

      try {
      System.out.println("<<< CMCommodityDB constructor - getting handle to session bean from session tracking...");
      Handle cmMaintSessionHandle = (Handle) session.getAttribute("CMMaintSessionHandle");

      System.out.println("<<< CMCommodityDB constructor - session handle: "+cmMaintSessionHandle.getClass().getName());
      if (cmMaintSessionHandle == null)
      System.out.println("<<< CMCommodityDB constructor: CMMaintSession not found in session tracking...");

      System.out.println("<<< CMCommodityDB constructor - about to get session bean from the handel...");
      Object o = cmMaintSessionHandle.getEJBObject();
      System.out.println("<<< CMCommodityDB constructor - getting the session bean from the handle: "+o.getClass().getName());
      m_cmMaintSession = (CMMaintSession) cmMaintSessionHandle.getEJBObject();
      } catch (RemoteException e) {
      System.out.println("<<< CMCommodityDB constructor - RemoteException: "+e.getMessage());
      throw new JApplicationException(JApplicationException.NOPROCESS, e.getMessage());
      } catch (EJBException e) {
      System.out.println("<<< CMCommodityDB constructor - EJBException: "+e.getMessage());
      throw new JApplicationException(JApplicationException.NOPROCESS, e.getMessage());
      } catch (NullPointerException e) {
      System.out.println("<<< CMCommodityDB constructor - NullPointerException: "+e.getMessage());
      throw new JApplicationException(JApplicationException.NOPROCESS, e.getMessage());
      }


      The code throws a NullPointException in org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:128)

      from the following line in my code:

      Object o = cmMaintSessionHandle.getEJBObject();

      Here is a portion of the server.log file:

      2004-08-06 13:34:44,987 INFO [STDOUT] <<< Authenticate.authenticate() - getting connection...
      2004-08-06 13:34:46,622 INFO [STDOUT] ORACLE CONNECTION made by: jurban to jdbc:oracle:thin:@raindev-emt:1527:ecvmd
      2004-08-06 13:34:46,623 INFO [STDOUT] <<< Authenticate.authenticate() - got connection...
      2004-08-06 13:34:47,031 INFO [STDOUT] <<< CMMaintSessionBean.setSessionContext()
      2004-08-06 13:34:47,046 DEBUG [org.jboss.ejb.StatefulSessionContainer] Created new session ID: dxkntmdi-4
      2004-08-06 13:34:47,054 DEBUG [org.jboss.ejb.StatefulSessionContainer] Using create method for session: public void cmMaintSession.CMMa
      intSessionBean.ejbCreate() throws java.rmi.RemoteException,javax.ejb.CreateException
      2004-08-06 13:34:47,055 INFO [STDOUT] <<< CMMaintSessionBean.ejbCreate()
      2004-08-06 13:34:47,060 DEBUG [org.jboss.proxy.ejb.ProxyFactory] seting invoker proxy binding for stateful session: stateful-rmi-invoke
      r
      2004-08-06 13:34:47,246 INFO [STDOUT] <<< CMMaintLoginDB.setUserInfo() - calling setUser on session bean...
      2004-08-06 13:34:47,259 INFO [STDOUT] <<< CMMaintLoginDB.setUserInfo() - calling initialize on session bean...
      2004-08-06 13:34:47,261 INFO [STDOUT] <<< CMMaintSessionBean.initialize()
      2004-08-06 13:34:47,261 INFO [STDOUT] CMMaintSessionBean.getUniqueDBConnection() - getting unique db connection...
      2004-08-06 13:34:47,566 INFO [STDOUT] ORACLE CONNECTION made by: jurban to jdbc:oracle:thin:@db:1111:sid
      2004-08-06 13:34:47,569 INFO [STDOUT]
      2004-08-06 13:34:49,645 INFO [STDOUT] <<< CMMaintLoginDB.setUserInfo() - storing handle to session bean in session tracking...
      2004-08-06 13:34:49,660 INFO [STDOUT] <<< Mediator.doPost() - directorName: /CMMaintDirector
      2004-08-06 13:34:49,662 INFO [STDOUT] ********** REQUEST **********
      2004-08-06 13:34:49,662 INFO [STDOUT] ********** SystemRequest: CMCommodityScreen
      2004-08-06 13:34:49,663 INFO [STDOUT] ********** event: top
      2004-08-06 13:34:49,663 INFO [STDOUT] ********** System: CMMaint
      2004-08-06 13:34:49,664 INFO [STDOUT] <<< CMMaintDirector.callJSP() - forwarding to url: /cmMaint/CMCommodityScreen.jsp
      2004-08-06 13:34:49,722 INFO [STDOUT] <<< CMCommodityScreen.jsp - 1
      2004-08-06 13:34:49,731 INFO [STDOUT] <<< CMCommodityDB constructor - getting handle to session bean from session tracking...
      2004-08-06 13:34:49,732 INFO [STDOUT] <<< CMCommodityDB constructor - getting the session bean from the handle...
      2004-08-06 13:34:49,749 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:128)
      at org.jboss.ejb.plugins.TxInterceptorBMT.invokeHome(TxInterceptorBMT.java:56)
      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:102)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      at org.jboss.ejb.StatefulSessionContainer.internalInvokeHome(StatefulSessionContainer.java:404)
      at org.jboss.ejb.Container.invoke(Container.java:743)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
      at org.jboss.proxy.ejb.handle.StatefulHandleImpl.getEJBObject(StatefulHandleImpl.java:154)
      at cmHelper.CMCommodityDB.(CMCommodityDB.java:38)
      at cmHelper.CMCommodityWB.processRequest(CMCommodityWB.java:55)
      at org.apache.jsp.cmMaint.CMCommodityScreen_jsp._jspService(CMCommodityScreen_jsp.java:74)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at cmServlets.CMMaintDirector.callJSP(CMMaintDirector.java:292)
      at cmServlets.CMMaintDirector.service(CMMaintDirector.java:171)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at cmServlets.Mediator.doPost(Mediator.java:91)
      at cmServlets.Mediator.doGet(Mediator.java:56)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:536)
      2004-08-06 13:34:49,771 INFO [STDOUT] <<< CMCommodityDB constructor - RemoteException: Could not get EJBObject; nested exception is:
      java.rmi.ServerException: RuntimeException; nested exception is:
      java.lang.NullPointerException
      2004-08-06 13:34:49,774 INFO [STDOUT] <<< CMCommodityScreen.jsp - 2
      2004-08-06 13:34:49,775 INFO [STDOUT] <<< CMCommodityScreen.jsp - 3
      2004-08-06 13:34:49,776 INFO [STDOUT] <<< CMCommodityScreen.jsp Error Status from WorkerBean: Could not get EJBObject; nested exceptio
      n is:
      java.rmi.ServerException: RuntimeException; nested exception is:
      java.lang.NullPointerException
      2004-08-06 13:34:49,777 INFO [STDOUT] <<< CMCommodityScreen.jsp - error: Could not get EJBObject; nested exception is:
      java.rmi.ServerException: RuntimeException; nested exception is:
      java.lang.NullPointerException