This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Netbeans (7.4) shows an error (red wavy line and icon) if a interceptor binding with @Target({TYPE, METHOD}) is used on a bean with a @PostConstruct method, even if the interceptor is not a lifecycle callback interceptor (doesn't have a @PostConstruct or any other lifecycle methods). An interceptor binding like this @InterceptorBinding @Retention(RUNTIME) @Target({TYPE, METHOD}) public @interface MyBinding {} and an interceptor like this: @Interceptor @MyBinding public class MyInterceptor implements Serializable { @AroundInvoke public Object interceptInvoke(InvocationContext ctx) throws Exception { //something return ctx.proceed() } } Results in an errormessage on the @PostConstruct method when this binding is applied to a bean: @Named @MyBinding public class SomeBean { @PostConstruct public void init() { } } Message is "Interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as @Target(TYPE)". But MyInterceptor is not a lifecycle callback interceptor, and doesn't apply to the init() method as it doesn't have a @PostConstruct method. The error message is correct for lifecycle interceptors, but @AroundInvoke interceptors are allowed to have @Target({TYPE, METHOD}).
*** Bug 242610 has been marked as a duplicate of this bug. ***
Fixed in web-main 3c8ffefdd7ea.
Integrated into 'main-silver', will be available in build *201506140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3c8ffefdd7ea User: Petr Hejl <phejl@netbeans.org> Log: #238882 - @AroundInvoke interceptor bindings with @Target({TYPE, METHOD}) shows as an error.