2 Replies Latest reply on Jun 30, 2004 12:12 PM by karstents

    Recursive. Recursive. Recursive. Exception.

    karstents

      Hey All!

      I am trying to write a scheduling tool. The deal is the assignment of employees to shifts. So, there is a SessionBean that walks throught employees and shifts to find the perfect plan.

      However, this is a SessionBean, called by a MessageDrivvenBean, that has a recursive method. As there are 25 employees and about 600 shifts it takes some time, the first recursive call nearly 15 seconds.

      After putting the timeout to a higher level, it runs quite a while. After about 10 Minutes there's a first error like this:

      17:07:51,703 WARN [AbstractInstanceCache] Unable to passivate due to ctx lock, id=1


      Those come up more often with different IDs (and heck only knows what IDs that may be) untill about 18 minutes after starting the schedule there comes an errorstack that ends up like this:
      [... a whole lot of lines with the recursive method]
      17:14:46,187 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:14:46,187 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:14:46,187 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:14:46,187 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      17:14:46,187 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
      17:14:46,187 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:700)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
      17:14:46,203 ERROR [STDERR] at $Proxy100.schedule(Unknown Source)
      17:14:46,203 ERROR [STDERR] at medsched.logic.bean.SchedulingBean.onMessage(SchedulingBean.java:56)
      17:14:46,203 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:14:46,203 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:14:46,203 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:14:46,203 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
      17:14:46,203 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:240)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:700)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
      17:14:46,203 ERROR [STDERR] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
      17:14:46,203 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
      17:14:46,203 ERROR [STDERR] at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
      17:14:46,203 ERROR [STDERR] at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
      17:14:46,203 ERROR [STDERR] at org.jboss.mq.SpySession.run(SpySession.java:298)
      17:14:46,203 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
      17:14:46,203 ERROR [STDERR] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
      17:14:46,203 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)
      17:14:46,203 INFO [STDOUT] SchedulingBean: Can't process Scheduling...
      javax.ejb.EJBException: RuntimeException; CausedByException is:
       Already associated with a tx
      17:14:46,203 INFO [STDOUT] SchedulingBean: Finished scheduling for 3/2004 in 1119516ms.


      What may be the problem? I'm not working with transaktions and I surely don't want the EntityBeans i'm working with to be passivated.
      Where is the mistake and what am I doing wrong?

      Thanks for your time and help,
      Karsten