This rule flags @Target values other than ElementType.TYPE on custom annotations that meet the following conditions:
@InterceptorBinding.@Interceptor.The following are lifecycle interceptor annotations:
The following example does not comply with the Java EE 7 Contexts and Dependency Injection (CDI) 1.2 specification but was tolerated in the CDI 1.0 implementation, which is based on the Apache OpenWebBeans implementation. In CDI 1.2, which is based on the Weld implementation, the application does not start.
|
To resolve this issue, remove the ElementType.METHOD from the @Target annotation, and remove all references to the annotation on application methods.
If any element types other than ElementType.TYPE are specified, they must also be removed.
For more information about the Java EE 7 CDI 1.2 implementation, see Contexts and Dependency Injection 1.2 behavior changes.