2 Replies Latest reply on Sep 30, 2001 12:28 PM by Tobias Frech

    Using a subclass for an Entity Bean implementation

    Julia C Newbie

      Hey, I have a class which implements Entity Bean and has some common functionality.

      For example:

      public class CommonEntityBean implements EntityBean {
      public Long id;
      public void setId(Long val) { id = val; }
      public Long getId() { return id; }
      }

      Then I have a few subclasses which extend it:

      public class AlphaEntityBean extends CommonEntityBean {
      // some stuff specific to AlphaEntityBean
      }

      Then I have a remote interface to go with it:

      public interface Alpha extends EJBObject {
      public void setId(Long val) throws RemoteException;
      public Long getId() throws RemoteException;
      }

      When I deploy it says -
      Section: 9.2.7
      Warning: For each method defined in the remote interface, there must be a matching method in the entity bean's class that has the same name and argument types.

      The matching method is there, it's public, it's just in the superclass, and when I paste it into the subclass code it works fine.

      So why can't the deployer see public methods in the superclass?

      Is this a bug in JBoss or is does the EJB spec say that you can't subclass an EJB implementation class?

      Thank you.