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

Can not inject bean from module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • 21.0.1.Final
    • CDI / Weld, Class Loading
    • None
    • Hide

      I attach reproduce_sample.zip file which contains maven project. 

      I also attach mymodule.zip file which contains Wildfly module. 

      1.  Unzip mymodule.zip and place it in modules directory in Wildfly. 

      2. Unzip reproduce_sample.zip archive. 

      3. Build reproduce_sample project with

      mvn clean package

      command. 

      4. Deploy MyWar\target\MyWar-1.0-SNAPSHOT.war archive on Wildfly. 

      Show
      I attach reproduce_sample.zip file which contains maven project.  I also attach mymodule.zip file which contains Wildfly module.  1.  Unzip mymodule.zip and place it in modules directory in Wildfly.  2. Unzip reproduce_sample.zip archive.  3. Build reproduce_sample project with mvn clean package command.  4. Deploy MyWar\target\MyWar-1.0-SNAPSHOT.war archive on Wildfly. 
    • Workaround Exists
    • Hide

      It can be workaround by registering my module as global module

      <global-modules>
          <module name="org.example.mymodule" slot="main" /> 
       </global-modules>
      Show
      It can be workaround by registering my module as global module <global-modules>     <module name= "org.example.mymodule" slot= "main" /> </global-modules>
    • Undefined
    • ---
    • ---

    Description

      Bean from module cannot be injected to bean in deployment.  It works properly on Wildfly 20.0.1.Final but does not work on Wildlfy 21.0.1.Final. 

      I registered module which contains @ApplicationScoped CDI bean. I tried do deploy WAR archive that contains library that depends on this module. The library contains proper entry in Dependencies section in MANIFEST.MF file.

       I get exception:

       

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type HelloService with qualifiers @Default
       at injection point [BackedAnnotatedField] @Inject com.example.mylib.MyLib.helloService
       at com.example.mylib.MyLib.helloService(MyLib.java:0)
      at org.jboss.weld.core@3.1.5.Final//org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
      

       

       

       

       

       

      Attachments

        Activity

          People

            manovotn Matěj Novotný
            mkulig@psi.pl Mariusz Kulig (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: