Search code examples
jsf-2cdijsf-2.2inject

@Inject Annotation not applicable Error shown?


I have created new project via Java Web->WebApplication->Enabled CDI

My First question is: Why @Inject annotation showing error? even though bean.xml added.

Inject Exception


Solution

  • As mentioned in injects documentation, it is applicable to constructors, methods and fields. Not classes.

    For question 2, please refer to this other question