title: Understanding CDI/Weld in multi-module application
body: <p>I have an application which is packaged in an EAR containing many JARs (with EJBs, libraries, 3rd-party-libraries, ...) and a single WAR (again containing some other JARs). The application is deployed in an JEE7 container (Wildfly 8.0.0.Final) and using CDI (Weld 2.1.2.Final shipped with Wildfly).</p>
  
  <p>In my understanding, Weld is active application-wide and has a single application-wide view. So it doesn't matter where I want to use CDI - it works.</p>
  
  <p>But there are some indications which lead to the assumption that this is not true. E.g. the <code>toString</code>-method of the <code>BeanManager</code> shows different output in different modules:</p>
  
  <p>When using the <code>BeanManager</code> in some module which is packaged in the war I get
  <code>Weld BeanManager for test-ear-1.0-SNAPSHOT.ear/test-webui-frontend-1.0-SNAPSHOT.war/WEB-INF/lib/test-webui-backend-1.0-SNAPSHOT.jar [bean count=76]</code>.</p>
  
  <p>If it is used in a library directly contained in the EAR:
  <code>Weld BeanManager for test-ear-1.0-SNAPSHOT.ear/test-ejb3-dao-1.0-SNAPSHOT.jar/ [bean count=224]</code>.</p>
  
  <p>So it seems that these <code>BeanManagers</code> are "responsible for" different parts of the application. Is this true?</p>