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
object is not an instance of declaring class; nested exception is:
javax.ejb.EJBException: Internal error getting primary key field member Bi
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();
Context initial = new InitialContext();
Object objRef = initial.lookup("PayReg/PayRegEJB");
PayRegHome home = (PayRegHome) PortableRemoteObject.narrow(objRef, PayRegHome.class);
PayReg = home.findByPrimaryKey(pk);
What version of JBoss are you using? If you are not using atleast 3.0.2 upgrade and try again.