[weld-issues] [JBoss JIRA] Commented: (WELD-975) Programmatic lookup with @New qualifier not working

Martin Kouba (JIRA) jira-events at lists.jboss.org
Fri Sep 23 03:12:26 EDT 2011


    [ https://issues.jboss.org/browse/WELD-975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630141#comment-12630141 ] 

Martin Kouba commented on WELD-975:
-----------------------------------

Current spec states even more complicated example (page 47):
{code}
@Inject @New(ChequePaymentProcessor.class) Instance<PaymentProcessor> chequePaymentProcessor;
{code}

> Programmatic lookup with @New qualifier not working
> ---------------------------------------------------
>
>                 Key: WELD-975
>                 URL: https://issues.jboss.org/browse/WELD-975
>             Project: Weld
>          Issue Type: Bug
>    Affects Versions: 1.1.2.Final
>         Environment: JBoss AS7
> TestNG
> Arquillian CR5
>            Reporter: Martin Kouba
>
> 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:
> {code}
> @Inject @New Instance<Foo> foo;
> {code}
> results in:
> {code}
> 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)]
> {code}
> after trying to obtain reference via get() method.
> Following code works ok:
> {code}
> @Inject @New Foo foo;
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list