2 Replies Latest reply on Jan 11, 2010 9:14 PM by prabhat.jha

    PostConstruct annotation ignored

    ppitonak
      Hi,
      I'm working on a sample application that uses RF 3.3.3.BETA1 + JSF 2.
      @ManagedBean(eager = true)
      @ApplicationScoped 
      public class RatesBean {
       
          private Map<String, String> currencyNames;
          // ...
       
          @PostConstruct
          @SuppressWarnings("unused")
          private void initialize() {
              currencyNames = new HashMap<String, String>();
              currencyNames.put(...);
          }
      }
      
      The code works as expected in Tomcat but in JBoss AS the method initialize is not called and thus currencyNames is null. Moving this code into a constructor helps, but in another bean I use injected variables so I have to use PostConstruct annotation. What am I doing wrong? I tried it with JBoss 5.1.0.GA and 6.0.0.M1.
      Thanks
      Palo