0 Replies Latest reply on Mar 13, 2008 5:16 PM by mmrack

    The post-construct in ejb-jar.xml does not recognize inherit

    mmrack

      When I use in ejb-jar.xml:

      <enterprise-beans>

      <ejb-name>StartupEjb</ejb-name>
      <ejb-class>StartupEjb</ejb-class>
      <post-construct>
      <lifecycle-callback-method>
      onStart
      </lifecycle-callback-method>
      </post-construct>

      </enterprise-beans>

      and my EJB structure is:

      //The business interface
      @Remote
      public interface IStartup {
      void login();
      }

      //The "general" base class for all EJB´s
      public abstract class AbstractEjb {
      public void onStart() {
      System.out.println("NOW STARTING UP");
      }
      }

      //The EJB
      @Stateless
      public class StartupEjb extends AbstractEjb implements IStartup {
      public String sayHello(String nome) {
      return "Hello " + nome;
      }
      }

      When this package is deployed, the log bellow was generated:

      18:01:05,546 WARN [JmxKernelAbstraction] jboss.j2ee:jar=startup-ejb.jar,name=StartupEjb,service=EJB3 is not registered
      18:01:05,703 WARN [Ejb3DescriptorHandler] No method found within StartupEjb with name onStart with the right signature for post-construct-m
      ethodwas found
      18:01:05,828 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:01:05,828 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=startup-ejb.jar,name=StartupEjb,service=EJB3 with dependencies:
      18:01:05,843 INFO [EJBContainer] STARTED EJB: StartupEjb ejbName: StartupEjb
      18:01:05,890 INFO [EJB3Deployer] Deployed: file:/C:/freeTools/jboss-4.2.2.GA/server/default/deploy/startup-ejb.jar

      If I use de @PostConstruct over the AbstractEjb#onStart() method or if I override onStart() method in StartupEjb, all works fine.

      Is it a bug or some mistake ?