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

JEE resources do not get injected if a specialization of a bean is provided via an extension in 5.1.3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.0.0.CR1, 5.1.4.Final
    • 5.1.3.Final
    • None
    • None

      A simple bean that has JEE resource injection and a specialization:

      	@ApplicationScoped
      	public static class A {
      
      		@Resource(name = "world")
      		private String value;
      
      		public String value() {
      			return "hello " + value;
      		}
      
      	}
      
      	@ApplicationScoped
      	@Specializes
      	public static class B extends A {
      
      	}
      

      The injection of "value" works if A and B are found via discovery. If B is provided by
      an extension as follows:

      	void afterTypeDiscovery(@Observes AfterTypeDiscovery event, BeanManager bm) {
      			event.addAnnotatedType(bm.createAnnotatedType(B.class), B.class.getName());
      		}
      

      then "value" is no longer injected.

      This worked in 5.1.2 and fails in 5.1.3.

              manovotn Matěj Novotný
              pms11 Mirko Streckenbach (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: