3 Replies Latest reply on Nov 10, 2002 5:20 PM by Erik Wright

    JBoss: "removing bean lock and it has tx set!"

    Erik Wright Newbie

      Hello,

      I hope someone can help me with the following problem. When accessing my entity beans from my own application (run on the command line) I receive an exception saying: "removing bean lock and it has tx set!". (Full stack trace below) When I run exactly the same test, but from a servlet (using apache's Cactus test framework) the code executes fine.

      My code creates an entity bean and then calls a function on the bean's remote interface. The function (which accesses a database) executes successfully (which I can tell by remote debugging JBoss). But before returning, the exception is thrown.

      (BTW my database code is built using Apache Torque, which includes its own transaction support by using Connection.setAutoCommit (false).... I've tried disabling this to see if there's a conflict - but no change)

      Stack trace follows - any help immensely appreciated! - Erik

      15:59:09,682 ERROR [LogInterceptor] RuntimeException:
      java.lang.IllegalStateException: removing bean lock and it has tx set!ejb/galileo/VendorEntity VendorEntityPK [ 1000 ]
      at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBLock.java:427)
      at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:107)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:124)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.Container.invoke(Container.java:712)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:536)