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
this is weird. You should be able to "inject null" in this case. Could you share your unit test somewhere (github)?
FYI I've just tried to reproduce the problem with no success. So we will definitely need your test .
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.
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