Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4419

Dependency on a deployed CDI module - beans are not injected

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 9.0.0.Beta2
    • 8.2.0.Final
    • CDI / Weld
    • None

      I want to deploy two modules to wildfly 8.2.0 The module-a contains beans (and later CDI producer and other stuff) and module-b use this beans. Beans from module-a should be injected with CDI in module-b (There is a beans.xml in both modules.). All works fine if the module-a is direct referenced as dependency like this:
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
      <deployment>
      <dependencies>
      <module name="deployment.module-a-1.0.0.jar" meta-inf="import" />
      </dependencies>
      </deployment>
      </jboss-deployment-structure>

      But the dependency to module-a should be without to know the deployed version, so I tried to set a module alias and (or) to re-export module-a under a different name like this.
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
      <deployment>
      <module-alias name="deployment.module-a-alias" />
      </deployment>
      </jboss-deployment-structure>

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
      <module name="deployment.module-a">
      <module-alias name="deployment.module-a-alias" />
      <dependencies>
      <module name="deployment.module-a-1.0.0.jar" export="true" meta-inf="export" />
      </dependencies>
      </module>
      </jboss-deployment-structure>

      But either the module alias or a re-export under a new module name worked. The reported exception is always:
      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type XYZ with qualifiers @Default

      The module alias fit my requirements and I guess is should work with CDI but it dosn't.
      Two questions:

      • Why CDI don't work with module alias and module re-export?
      • How to deal with dependencies and module versions?

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              dibu_jira Dirk Buchhorn (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: