ORION 0.8.2
Windows NT 4sp5
I have an Entity bean which has the following home interface:
public interface EntityHome extends EJBHome {
public Entity create(String name) throws CreateException, RemoteException;
public Entity create(long id, String name) throws CreateException,
RemoteException;
public Entity findByPrimaryKey(long key) throws RemoteException,
FinderException;
};
Note the two create methods, one which takes a primary key (id) and the
other one does not. In the EntityEJB I have defined the following two
variations of ejbCreate. One takes id and name, and the other one takes
only the name. The ultimate goal is to use the second constructor and
generate unique id.
public class EntityEJB implements EntityBean {
public java.lang.Long ejbCreate(long id, String name) throws
CreateException {
this.id = 1;
this.name = name;
return new Long(this.id);
}
public void ejbPostCreate(long id, String name) {
}
public java.lang.Long ejbCreate(String name) throws CreateException {
this.id = 1;
this.name = name;
return new Long(this.id);
}
public void ejbPostCreate(String name) {
}
};
>From my client, when I call the first constructor like so:
Entity one = (Entity) PortableRemoteObject.narrow(home.create(1, "One"),
Entity.class);
all works fine and the record is saved to the database. When I clear the
database, recycle orion and try to call the second constructor like so:
Entity one = (Entity) PortableRemoteObject.narrow(home.create("One"),
Entity.class);
I get the following exception on the client:
Exception in thread "main"
com.evermind.reflect.UndeclaredExceptionTypeException:
java.lang.AbstractMethodError
at Proxy0.create(Unknown Source)
at EntityClient.main(EntityClient.java:32)
Is there something in EJB which states that all Container managed entity
bean create methods should take a primary key as the argument? I looked
over the EJB 1.1 spec and it does not say anything about such a requirement.
I am including my source code for reference.
Thanks.
-AP_
Entity.java
EntityClient.java
EntityEJB.java
EntityHome.java