Discussions

EJB design: EJB Inheritance

  1. EJB Inheritance (1 messages)

    Hi,
      Child class inherits class Parent and child class is a bean (stateless session), when I call the parent class method inside child, i get NoSuchMethod error.
      i.e., I chave an initialize method in the local interface of the child bean which will call parent class initialize method which is a simple class, now I call the initialize method of this child bean from another bean, i get no such method exception.

    and also can I use the InitialContext object of the Child bean in the Parent class by passing it as a parameter to parents initialize method. If I use it i get a NullPointerException if I lookup some thing using the passed context object.

    can any one help me out.

    Thanking in advance.

    Regards,
    Sathish
  2. About EJB Inheritance[ Go to top ]

    AFAIK EJB inheritance is seldom used.. may be you need to modify your
    components design, however if you really need to implement it, I've
    found an article on the subject when I was researching on the topic:

    http://www.onjava.com/pub/a/onjava/2002/11/13/ejbinherit3.html

    Which covers a way to use EJB inheritance for Session Beans.

    Regards,

    Diego