7 Replies Latest reply on Mar 1, 2008 1:24 AM by hang liu

    NullPointerException when  call  the  get(..)  method, Who c

    hang liu Newbie

      I have two tree caches in the cluster.

      Fllowing is the exception stacktrace . The last row has no more stacks, so it is versy strange. Who can help me ?


      java.lang.RuntimeException: java.lang.NullPointerException
      at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5523)
      at org.jboss.cache.TreeCache.get(TreeCache.java:3468)
      at org.jboss.cache.TreeCache.get(TreeCache.java:3449)
      at com.primeton.eos.wf.service.instpool.treecache.optimize.WFInstancePoolOptimize.findProcessInstanceByID(WFInstancePoolOptimize.java:293)
      at com.primeton.eos.wf.service.instpool.treecache.optimize.WFInstancePoolOptimize.findProcessInstanceByID(WFInstancePoolOptimize.java:421)
      at com.primeton.eos.wf.service.api.systemlog.InstPoolSync.syncInner(InstPoolSync.java:100)
      at com.primeton.eos.wf.service.api.systemlog.InstPoolSync.sync(InstPoolSync.java:96)
      at com.primeton.eos.wf.service.api.systemlog.InstPoolSync.syncByWorkItemID(InstPoolSync.java:85)
      at com.primeton.eos.wf.engine.worklist.WorklistQueryManagerImpl.queryWorkItemByID(WorklistQueryManagerImpl.java:1079)
      at com.primeton.eos.wf.engxml.EngineXMLAdaptor.queryWorkItemByID(EngineXMLAdaptor.java:1662)
      at com.primeton.eos.wf.bizlet.WorklistQueryManager.BL_queryWorkItemByID(Unknown Source)
      ... 32 more
      Caused by: java.lang.NullPointerException

        • 1. Re: NullPointerException when  call  the  get(..)  method, W
          hang liu Newbie

          Forget to tell you , the version is 1.4.0.

          • 2. Re: NullPointerException when  call  the  get(..)  method, W
            hang liu Newbie

            The exception only occured in concurrent invocations.

            • 3. Re: NullPointerException when  call  the  get(..)  method, W
              Mircea Markus Master

              Is this the first things that happens imediatelly after starting the cache? Logs indicated that interceptor stack is null, which is strange indeed. I also suggest upgrading to 1.4.0.SP1

              • 4. Re: NullPointerException when  call  the  get(..)  method, W
                hang liu Newbie


                This is not the first things happened immediatelly after the cache start.

                I modified my code ,now I get the fllowing exception stack. It is more clearly.
                NullpointerException throws in the wasRemovedInTx method of CacheLoaderInterceptor class.
                It seams that the 'entry' is null.
                I also paste the function code.
                Still need your help!

                Exception Stack:
                -----------------------------------------------------------
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
                at com.primeton.eos.fbframe.fbrole.security.filter.WebSecurityFilter.doFilter(WebSecurityFilter.java:101)
                at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
                at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
                at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
                at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
                at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
                at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
                at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
                Caused by: java.lang.NullPointerException
                at org.jboss.cache.interceptors.CacheLoaderInterceptor.wasRemovedInTx(CacheLoaderInterceptor.java:307)
                at org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(CacheLoaderInterceptor.java:164)
                at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
                at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:32)
                at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
                at org.jboss.cache.interceptors.InvalidationInterceptor.invoke(InvalidationInterceptor.java:60)
                at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
                at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:345)
                at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:156)
                at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
                at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:138)
                at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5517)
                ... 44 more


                The Excepton Code in jbosscache
                -------------------------------------------------------------
                private boolean wasRemovedInTx(Fqn fqn)
                {
                GlobalTransaction t = getInvocationContext().getGlobalTransaction();
                if (t == null)
                return false;
                TransactionEntry entry = txTable.get(t);
                Iterator i = entry.getCacheLoaderModifications().iterator(); ( ------------------ row 307----)
                while (i.hasNext())
                {
                JBCMethodCall m = (JBCMethodCall)i.next();
                if (m.getMethodId() == MethodDeclarations.removeNodeMethodLocal_id
                && fqn.isChildOrEquals((Fqn)m.getArgs()[1]))
                return true;
                }
                return false;
                }

                • 5. Re: NullPointerException when  call  the  get(..)  method, W
                  hang liu Newbie

                  I suppose there is some relation to tx. This get method is not in tx . I also have many 'get' calls in tx,they runs correctly! But why 'get' calls must in tx envirement?

                  • 6. Re: NullPointerException when  call  the  get(..)  method, W
                    Mircea Markus Master

                    This looks very much like a bug. I've tried some scenarios to reproduce it, but couldn't. Can you please post your configuration, and also some code to describe the cache access pattern in which the failure occurs (tx is started? am I doing a get on a non existent node?) A unit test to reproduce the issue would be great!
                    Thanks, mircea

                    • 7. Re: NullPointerException when  call  the  get(..)  method, W
                      hang liu Newbie

                      Thanks for attention!

                      I've post my config in another post:http://jboss.org/index.html?module=bb&op=viewtopic&t=130898

                      Now I have another fatal problem ,and I am working with it.

                      If i have time later, i'll have you to reproduce it.
                      Thank you !