-
1. Re: WELD-001456: Argument resolvedBean must not be null?
tremes Oct 21, 2016 2:27 AM (in response to ljnelson)Hi Laird,
Yes your producer can return null (must be Dependent scope). But when Weld performs injection it checks whether it has "something" to inject. In other words you can't inject null value due to Weld validation (which is fully reasonable) - see core/Preconditions.java at master · weld/core · GitHub
-
2. Re: WELD-001456: Argument resolvedBean must not be null?
mkouba Oct 21, 2016 2:45 AM (in response to ljnelson)Hi Laird,
this is weird. You should be able to "inject null" in this case. Could you share your unit test somewhere (github)?
-
3. Re: WELD-001456: Argument resolvedBean must not be null?
mkouba Oct 21, 2016 3:55 AM (in response to ljnelson)FYI I've just tried to reproduce the problem with no success. So we will definitely need your test .
-
4. Re: WELD-001456: Argument resolvedBean must not be null?
tremes Oct 21, 2016 4:25 AM (in response to mkouba)Ok sorry I didn't realize that it cannot find the corresponding bean. Then it's little bit weird so some test or at least complete class definition would be definitely helpful.
-
5. Re: WELD-001456: Argument resolvedBean must not be null?
ljnelson Oct 21, 2016 12:45 PM (in response to tremes)I am going to chalk this up to pilot error as I cannot now reproduce the
problem. If this is not a clear case of "Oh, you forgot to initialize the
frobnicator", then I am sure I was just moving too fast. These are usually
signs that one should take a deep breath and go have a cup of tea for a
bit.
Best,
Laird