Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1777

Adding an extension to an EJB module makes producer methods disappear

XMLWordPrintable

      I created a test project with an EJB module, a WAR module and an EAR module. The WAR module has an endpoint with an injection point:

      @Inject private MyInjectable injectable;
      

      I have a producer for this in the EJB module:

      @ApplicationScoped public class MyProducer {
        @Produces MyInjectable getMyInjectable() { return new MyInjectable(); }
      }
      

      Finally, I added an extension that does nothing but listen to ProcessAnnotatedType. My CDI extension reference is this: https://docs.jboss.org/weld/reference/latest/en-US/html/extend.html

      The application fails to start:

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type MyInjectable with qualifiers @Default
        at injection point [BackedAnnotatedField] @Inject private test.MyEndpoint.injectable
        at test.MyEndpoint.injectable(MyEndpoint.java:0)
      

      If I rename my-ejb/src/main/resources/services to services.bak, and comment out the implements Extension in the MyExtension class, it starts up fine. It seems adding the extension to the EJB causes Weld to not process the producer methods (see startup.log).

        1. extension.ear
          6 kB
        2. startup.log
          36 kB
        3. test-src.zip
          9 kB

            mkouba@redhat.com Martin Kouba
            scott-20 Scott Van Wart (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: