2 Replies Latest reply on Jul 25, 2013 9:03 AM by Jeff Bride

    Weld does not find CDI Beans within AS7 modules

    Jeff Bride Novice

      Hi,

         I have an EAR application that attempts to inject CDI beans. 

         Those CDI beans have been deployed as static JBoss Modules in EAP6.1 and appropriate dependencies on those static modules have been defined in the app's jboss-deployment-structure.xml

         There have been many community posts regarding this topic as the CDI beans packaged as static modules do not get injected into my app out-of-the-box

       

         I'm wondering what the best approach is when using JBoss EAP 6.1 ?

       

        for example:   placing the following in my EAR application's jboss-deployment-structure.xml as suggested here :

       

         <dependencies>

              <module name="org.my.apps.modules"  export="true"  meta-inf="import" />

          </dependencies>

       

      leads to the following parsing error when my EAR is deployed:

       

      Message: JBAS018754: Unexpected content of type 'element start', name is '{urn:jboss:deployment-structure:1.0}module', text is: 'null'
      

       

       

      there is also this thread that recommends the use of CDI portable extensions.

      I've done a small prototype of this approach and it seems that it is feasible.

      however, is this approach still necessary ?

       

      there is also this thread that suggests the use of jandex.  However, the jandex repo in github  seems to no longer exist.   Is this still a viable approach ?