1 Reply Latest reply on Jan 4, 2003 8:05 PM by Odysseus Levy

    Problem with passivation

    Odysseus Levy Newbie

      My appliction works correctly until my entity beans get passivated. Then, when I try to access them, I get the following error:

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      javax.transaction.TransactionRolledbackException: removing bean lock and it has tx set!Player 0; CausedByException is:
      removing bean lock and it has tx set!Player 0; nested exception is:
      java.lang.IllegalStateException: removing bean lock and it has tx set!Player 0

      I am using JBoss 3.0.4, and I'm using the default configurations.

      My application is relatively simple: I have a Remote Stateful Session bean acting as the front for a number of Local CMP 2.0 managed Entity Beans. All of these Entity Beans use an Integer object as their primary key.

      I'm stumped on what to do next. Perhaps my transactions are getting messed up? I double checked all of my configuration files and they call for Required on all of my entity bean functions. Is there some way I can verify that the transactional state is properly finishing after a function call? Any suggestions would be greatly appreciated!

        • 1. Re: Problem with passivation
          Odysseus Levy Newbie

          OK,

          I found the problem -- in my EJBActivate() I made a call to a CMP managed field (to get my ID so that I could print out a debug statement). This is illegal since the bean has not yet been loaded in yet.

          For some reason, the error for this only shows up as a debug level trace call, and was not printing out to my console so I didn't notice it.

          In general, I guess when you get this error:

          javax.transaction.TransactionRolledbackException: removing bean lock and it has tx set!

          It quite likely means that an error was thrown during an earlier operation, and that is why the transaction state has not been cleared up. So if you get this error, set your trace level to a suitable level, and look for that other error.