0 Replies Latest reply on Jan 28, 2005 11:18 AM by Jason THompson

    IllegalArgumentException during heavy server load

    Jason THompson Newbie

      In my production environment, I get intermittent (10-50/day) exceptions like this:

      java.lang.IllegalArgumentException: Attempt to get lock ref with a null object
       at org.jboss.ejb.BeanLockManager.getLock(BeanLockManager.java:76)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor$InstanceSynchronization.<init>(EntitySynchronizationInterceptor.java:472)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.createSynchronization(EntitySynchronizationInterceptor.java:128)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.register(EntitySynchronizationInterceptor.java:149)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:313)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:175)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:484)
       at org.jboss.ejb.Container.invoke(Container.java:723)
       at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
       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.local.LocalInvoker.invoke(LocalInvoker.java:97)
       at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
       at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
       at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:53)
       at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:97)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
       at $Proxy158.getClientId(Unknown Source)
      
       ...(removed for the sake of brevity)


      I was able to reproduce on my test environment using a load test tool. I was also able to narrow it down to just a few lines of code:

       try{
      
       Application a = applicationHome.findByPrimaryKey(new ApplicationPK(2270861, 1));
       int cRev = a.getClientRevisionNumber(); //exception is here
       int cId = a.getClientId(); //or here
      
       }
       catch(Exception e) {
       e.printStackTrace();
       }


      This code works fine with very few users. If I ramp up the number of request to this code, it breaks. At 30 concurrent requests to this code, the fail rate is 50%.

      You'll note that everyone is asking for the same EJB. My original test case used unique EJBs, but the problem was more prevalent using only one EJB.

      This is a production app, so I have quite a few EJBs. I am able to replace the above code with similar code from any of my other EJBs and reproduce the problem.

      I saw a number of other posts on this topic. I am using BMP, it occurs in the absence of updates, and I'm using Sybase ASE, so CMP settings for db generated keys on MySQL is not the problem.

      The server is ussing Suse Linux 9.0, java 1.4.2, and jboss 3.2.6.

      Any ideas?