users@glassfish.java.net

Inheritance with Stateless Session Bean

From: Antonio Goncalves <antonio.mailing_at_gmail.com>
Date: Tue, 9 Oct 2007 21:21:41 +0200

Hi,

Inheritance with session bean has always been impossible (EJB 2.1 spec §D.3
: "The current EJB specification does not specify the concept of component
inheritance. There are complex issues that would have to be addressed in
order to define component inheritance."). You could extend from POJOs
(really useful to avoid coding all the empty ejbXXXX() methods), but that
was all. You couldn't do EJB extends another EJB (because it had to already
extend EJBObject).

With the EJB 3.0 spec, it's not as clear. And the funny thing is that EJB
inheritance works fine with GlassFish V2, but when you use NetBeans 5.5.1 to
write the code, it show a little error icon "The bean class cannot extend
another bean class".

Antonio