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

Programmatic lookup with @New qualifier not working

    XMLWordPrintable

Details

    Description

      According to spec: "...the @New qualifier may be used, allowing the application to obtain a @New qualified bean, as defined in Section 3.12, @New qualified beans" (CDI 1.0; chapter 5.6. Programmatic lookup).

      However using programmatic lookup with @New qualifier like:

      @Inject @New Instance<Foo> foo;
      

      results in:

      org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308 Unable to resolve any beans for Types: [class org.jboss.cditck.arquillian.instance.Foo]; Bindings: [@javax.enterprise.inject.New(value=org.jboss.cditck.arquillian.instance.Foo.class)]
      

      after trying to obtain reference via get() method.

      Following code works ok:

      @Inject @New Foo foo;
      

      Attachments

        Activity

          People

            rhn-engineering-jharting Jozef Hartinger
            mkouba@redhat.com Martin Kouba
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: