0 Replies Latest reply on Jul 10, 2002 1:28 PM by Saroj

    Error using Custom Primary Key class in JBOSS 3, cmp 2 + Hyp

    Saroj Newbie

      Hi All,


      When I am using Custom Primary key with JBOSS 3 , CMP2 with HYPERSONIC then this error I am getting :

      This is the full stack trace ...

      [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      [java] Caught an unexpected exception while making contract!
      [java] java.rmi.ServerException: removing bean lock and it has tx set!; nested exception is:
      [java] java.lang.IllegalStateException: removing bean lock and it has tx set!
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:536)
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      [java] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)
      [java] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
      [java] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      [java] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      [java] at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:116)
      [java] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      [java] at $Proxy1.getCustomerId(Unknown Source)
      [java] at test_ejbs.make_Customer(test_ejbs.java:84)
      [java] at test_ejbs.(test_ejbs.java:43)
      [java] at test_ejbs.main(test_ejbs.java:101)
      [java] Caused by: java.rmi.ServerException: removing bean lock and it has tx set!; nested exception is:
      [java] java.lang.IllegalStateException: removing bean lock and it has tx set!
      [java] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:119)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      [java] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      [java] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      [java] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      [java] at org.jboss.ejb.Container.invoke(Container.java:705)
      [java] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
      [java] at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:536)
      [java] Caused by: java.lang.IllegalStateException: removing bean lock and it has tx set!
      [java] at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBLock.java:469)
      [java] at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:78)
      [java] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:124)
      [java] at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      [java] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      [java] ... 19 more

      ****************************
      ** CustomPK ***
      ****************************

      I am using CustomPK like this:
      import java.io.*;

      public class CustomerPK implements Serializable
      {
      public String customerId ;

      public CustomerPK()
      {

      }

      public CustomerPK(String customerId)
      {
      this.customerId = customerId;
      }

      public String toString()
      {
      return customerId.toString();
      }

      public int HashCode()
      {
      return customerId.hashCode();
      }

      public boolean equals(Object obj)
      {
      if (obj instanceof CustomerPK)
      {
      CustomerPK c = (CustomerPK)obj;

      if (c.customerId == null)
      {
      return customerId == null;
      }

      return c.customerId.equals(customerId);
      }

      return false;
      }

      }


      TIA,
      Saroj