1 Reply Latest reply on Aug 27, 2002 1:59 PM by Dain Sundstrom

    I get error in client

    Dzidas Newbie

      Hello,
      I have Jboss 3.0.0 and postgres.
      I deploy bmp bean, and it deploy good.
      When i run client I get this errors:

      luzaujava.rmi.ServerException: RemoteException occurred in server thread; nested
      exception is:
      java.rmi.ServerException: removing bean lock and it has tx set!; nested
      exception is:
      java.lang.IllegalStateException: removing bean lock and it has tx set!
      java.rmi.ServerException: RemoteException occurred in server thread; nested exce
      ption is:
      java.rmi.ServerException: removing bean lock and it has tx set!; nested
      exception is:
      java.lang.IllegalStateException: removing bean lock and it has tx set!
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      --skip--

      My PK class:
      package bmanag;
      import java.io.Serializable;

      public class AccountPK implements java.io.Serializable
      {
      public String accountID;
      public AccountPK(String id)
      {
      this.accountID = id;
      }
      public AccountPK()
      {
      }
      public String toString()
      {
      System.out.println(accountID);
      return accountID;
      }

      public boolean equals(Object other)
      {
      boolean isEqual = false;
      //System.out.println("equals");
      if (other instanceof AccountPK)
      {
      if (accountID == null)
      isEqual = (accountID == ((AccountPK)other).accountID);
      else
      isEqual = (accountID == ((AccountPK)other).accountID);
      }
      return isEqual;
      }

      public int hashCode()
      {
      //System.out.println("hach");
      //return this.toString().hashCode();
      return accountID.hashCode();
      }
      }

      and half of my client code:
      package bmanag;
      import javax.ejb.*;
      import javax.naming.*;
      import java.rmi.*;
      import java.util.Enumeration;
      public class Client
      {
      public static void main(String[] args)
      {
      Account account = null;
      try
      {
      Context ctx = new InitialContext(System.getProperties());
      AccountHome home = (AccountHome) ctx.lookup("AccountHome");


      home.create("22","VW");

      Enumeration ezz = home.findByOwnerName("VW");
      if(ezz != null)
      {

      account = (Account) ezz.nextElement();
      if(null != account)
      {
      System.out.println(account.getOwnerName());

      when I try get function from account object, I get errors...
      Thanks