4 Replies Latest reply on Aug 30, 2007 1:20 PM by nemya

    Automatically run a method after constructor and injection i

    nemya

      Hi,
      I'm using Jboss Seam 1.2.1.GA + JBoss Server 4.0.5.GA.
      In a StateLess Session Bean I'd like to run a method automatically after the constructor invocation. This method uses an injected variable. I tried to invoke it in the constructor but this causes a NullPointerException. The exception is due to the fact that the injection isn't done yet.

      @In(create = true)
      private CollaborateurHome collaborateurHome;
      //My method
      public void init() {
       selectedCollaborateur = collaborateurHome.getDefinedInstance();
       remplirLignes();
       boiteNoire = ContratService.getSaisieActivite(lignes, dateDebut,dateFin);
      }