0 Replies Latest reply on Nov 19, 2003 9:26 PM by rizkaarifianto

    CMP - ERROR [BeanLock]

    rizkaarifianto

      Dear All,


      When I run my client app, I got this error in the jboss console. Please somebody help me to resolve this problem. Thanks

      client app:
      import java.util.*;
      import procat.ejb.catalog.*;

      public class CatalogNodeClient {

      public static void main(String args[]) throws Exception {

      CatalogNodeHome home = null;
      CatalogNodeClient pClient = new CatalogNodeClient();

      try {
      Properties props = new Properties();
      props.load(pClient.getClass().getClassLoader().getResourceAsStream("jndi.properties"));

      InitialContext ctx = new InitialContext(props);

      home = (CatalogNodeHome)PortableRemoteObject.narrow(
      ctx.lookup("CatalogNode"), CatalogNodeHome.class);

      Iterator i = home.findByNodeName(args[0]).iterator();
      System.out.println("These Products match the name P4-1.2");
      int c=1;
      while (i.hasNext()){
      System.out.println("Iterating record.."+(c++));
      CatalogNodeInterface obj = (CatalogNodeInterface) PortableRemoteObject.narrow(
      i.next(), CatalogNodeInterface.class);

      //error occured from here..
      System.out.println("\t"+obj.getNodeName());
      }
      }
      catch (Exception e){
      e.printStackTrace();
      }
      finally {
      //if (home != null) {
      }
      }
      }

      Error message:

      10:12:01,383 ERROR [BeanLock] removing bean lock and it has tx set! org.jboss.ej
      b.plugins.lock.QueuedPessimisticEJBLock@197d20c, bean=CatalogNode, id=procat.ejb
      .catalog.CatalogNodePK@161100c, refs=0, tx=TransactionImpl:XidImpl [FormatId=257
      , GlobalId=KERPEC_RIZKA_NB//31, BranchQual=], synched=null, timeout=5000, queue=
      []
      10:12:01,383 ERROR [LogInterceptor] RuntimeException:
      java.lang.IllegalStateException: removing bean lock and it has tx set!
      at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedP
      essimisticEJBLock.java:461)
      at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:116)

      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
      tor.java:106)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
      Interceptor.java:54)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      28)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
      java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
      ryFinderInterceptor.java:122)
      at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:490
      )
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      367)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.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:4
      60)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
      .java:701)
      at java.lang.Thread.run(Thread.java:534)