1 Reply Latest reply on Jan 14, 2010 7:30 AM by Celinio Fernandes

    [JBoss 6.0 M1]  EJB 3.0: @PostConstruct not called

    Celinio Fernandes Novice

      Hi,

      I have a pretty weird and basic problem.

      I have 2 session beans. One is stateful, the other one is stateless.

       

      Both have a method which is annotated with @PostConstruct :


          @PostConstruct
          public int test() {
              System.out.println("------------------test");
              log.info("****************test");

              myVar = 99;

              return myVar;
          }

       

      None returns the logs and the new value of myVar.

       

      How come ? The @PostConstruct annotation is used to annotate a method that should be called after instantiation.

      Some  tweaking to do in JBoss maybe ??

       

      Thanks for helping.