i faced this problem when want to remove a record from CMP entity bean.
17:31:19,946 ERROR [STDERR] java.rmi.ServerException: Internal error getting prima
y key field member Bin
Embedded Exception
object is not an instance of declaring class; nested exception is:
javax.ejb.EJBException: Internal error getting primary key field member Bi
Embedded Exception
object is not an instance of declaring class
This is the way i used to remove the record. Is anything wrong here?
PK pk = new PK();
pk.setBin(iBin);
pk.setCardNum(iCardnum);
pk.setPayeeCD(sPayeeCD);
pk.setRefNo(sOldRefNo);
pk.setRefName(sOldRefName);
Context initial = new InitialContext();
Object objRef = initial.lookup("PayReg/PayRegEJB");
PayRegHome home = (PayRegHome) PortableRemoteObject.narrow(objRef, PayRegHome.class);
PayReg PayReg=null;
PayReg = home.findByPrimaryKey(pk);
home.remove(PayReg);
What version of JBoss are you using? If you are not using atleast 3.0.2 upgrade and try again.