During the construction of the DataController
, it's normal the dataProvider
is null. Injection happens after that.
You should add a @PostConstruct
method to check for nullity of the field:
@PostConstruct
void init() {
// dataProvider should not be null here.
}
Aditionally, error reporting on Weld is pretty well done. So you should have an explicit and detailed error message if the injection fails, and not only a null field.