[
https://issues.apache.org/jira/browse/OWB-1038?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Struberg resolved OWB-1038.
--------------------------------
Resolution: Not a Problem
Assignee: Mark Struberg
Hi!
This behaviour is perfectly ok from a spec perspective. Here is one of the
references for it:
{quote}
The InjectionPoint interface defined in Section 5.5.7, “Injection point
metadata”, provides metadata about the injection point to the object being
injected into it.
{quote}
Now my question: In which object do you INJECT it in your programmatical lookup
case? Exactly: in none. Thus it the InjectionPoint parameter is null. See
OWB-921.
According to the CDI spec you need to use BeanManager#getInjectableReference if
you like to programmatically pass in an InjectionPoint.
Older versions of Weld btw also gave you null in your test. I would simply add
a null check and use @Default as qualifier if the InjectionPoint is null to
your producer method and be done.
I assume that Weld just creates a dummy InjectionPoint (which actually
contradicts the spec)...
> InjectionPoint is null when using @Produces. NullPointerException caused by
> CDI container providing a null InjectionPoint into a producer method.
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OWB-1038
> URL: https://issues.apache.org/jira/browse/OWB-1038
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.0, 1.2.6
> Environment: All Environment
> Reporter: Naveen Sisupalan
> Assignee: Mark Struberg
> Attachments: weld-test.zip
>
>
> Getting InjectionPoint null inside a producer method. Bootstrapped same
> project with JBoss Weld implementation everything worked as expected.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)