This content has been marked as final.
Show 6 replies
-
1. Re: WARN logs in InterceptorRegistry
wolfc Jan 6, 2009 4:21 PM (in response to jaikiran)Nice catch, it's missing an 'if'.
This needs to be properly fixed, so the assertion can take hold. We need to identify all scenarios in which methodApplicapleInterceptorClasses is null so we can come up with the proper fix. -
2. Re: WARN logs in InterceptorRegistry
lutz.vahl Jan 15, 2009 6:42 AM (in response to jaikiran)something new..?
-
3. Re: WARN logs in InterceptorRegistry
jaikiran Jan 15, 2009 7:06 AM (in response to jaikiran)Workaround, if you want to avoid those logs from showing up:
<category name="org.jboss.ejb3.interceptors.registry.InterceptorRegistry"> <priority value="ERROR"></priority> </category>
in your jboss-log4j.xml -
4. Re: WARN logs in InterceptorRegistry
jaikiran Feb 4, 2009 5:38 AM (in response to jaikiran)I have started work on fixing this. One of the issues (though not directly related) i see in this registry, is this:
Class<?> beanClass = advisor.getClazz(); for(Method beanMethod : ClassHelper.getAllMethods(beanClass)) { interceptorsAnnotation = (Interceptors) advisor.resolveAnnotation(beanMethod, Interceptors.class); List<Class<?>> methodInterceptorClasses = new ArrayList<Class<?>>(); if(interceptorsAnnotation != null) { for(Class<?> interceptorClass : interceptorsAnnotation.value()) methodInterceptorClasses.add(interceptorClass); } ...
From the EJB3 spec:Interceptors are used to interpose on business method invocations and lifecycle events that occur on an enterprise bean instance.
So, usingClassHelper.getAllMethods(beanClass)
doesn't look right. -
5. Re: WARN logs in InterceptorRegistry
jaikiran Feb 4, 2009 6:33 AM (in response to jaikiran)"wolfc" wrote:
We need to identify all scenarios in which methodApplicapleInterceptorClasses is null so we can come up with the proper fix.
One of the simplest valid cases would be a bean having no Interceptor(s) declared:@Stateless public class SimpleBean implements NoInterceptor { public void doNothing() { .... } }
There wont be any interceptors applicable (i.e. methodApplicapleInterceptorClasses == null) for that business method.This needs to be properly fixed, so the assertion can take hold
What is the use case where this assertion should hold? From the above example, i think its a valid scenario to have no interceptors applicable for a given method. Am i missing something? -
6. Re: WARN logs in InterceptorRegistry
wolfc Feb 4, 2009 7:49 AM (in response to jaikiran)"EJB 3.0 Chapter 12" wrote:
Interceptors are used to interpose on business method invocations and lifecycle events that occur on an enterprise bean instance.
The keyword here is 'invocations'.
Let's just say that it's beyond the scope of InterceptorRegistry to identify business methods and that getApplicableInterceptorClasses assumes that the argument is a business method."jaikiran" wrote:
There wont be any interceptors applicable (i.e. methodApplicapleInterceptorClasses == null) for that business method.
methodApplicableInterceptorClasses must not be null, it must be an empty list.