2 Replies Latest reply on Dec 4, 2009 7:45 AM by nickarls

    Location of beans.xml

      Hi,


      I've placed my beans.xml in my ear-file (/EarContent/META-INF/beans.xml).
      If I want to use the CDI Annotations (e.g. @Named) for one of my JSF-Beans in my war-file they aren't recognized.
      So I cannot access the bean via EL on a JSF page.
      If i put the beans.xml in my war-file (/WebContent/WEB-INF/beans.xml) everything works fine.
      Is it not possible to put the beans.xml into my META-INF directory of my ear-file?


      Alex

        • 1. Re: Location of beans.xml
          gavin.king

          Nope. Ears aren't bean archives (they can't directly contain bean classes). So it doesn't make sense to put beans.xml directly in the ear. A war is a bean archive.

          • 2. Re: Location of beans.xml
            nickarls

            OTOH, having a beans.xml on EAR level for application wide config (interceptors, alternatives) wouldn't perhaps be a bad idea but then the rules would have to propagate down the archive hierarchy (EAR -> WAR, EAR -> JAR)