3 Replies Latest reply on Jan 16, 2007 1:57 PM by Thomas Hamacher

    Initialization of Seam Application

    Thomas Hamacher Novice

      Hi,

      I have a problem accessing the properties of my seam application during startup.

      I´ve got the following Bean, that is started through the @Startup annotation.

      @Name("commonDataHelper")
      @Scope(ScopeType.APPLICATION)
      @Startup
      public class CommonDataHelper {
      
       @Logger
       private Log log;
      
       ...
      
       @Create
       public void init() {
      ....
       }


      But when I try to access the following Properties I always get an exception, so I´ve got the idea, that it might not have been initialized yet. Is this assumption true, or do I have an other misunderstanding?

      NPE if trying to access the application:

      Iterator<Locale> locales = FacesContext.getCurrentInstance().getApplication().getSupportedLocales();
      


      Can´t receive the seam-RessourceBundle of my war, but only the one that lies in the sourcepath of my ejb-jar:

      ResourceBundle rb = org.jboss.seam.core.ResourceBundle.instance().getBundle(bundleName, locale);


      Anyone knows why?
      I saw, that I could add a depends-value at the @Startup-annotation. But what would be the value to depend on?

      Thank you
      Thomas