Question

I was trying to use method level interceptor from message driven bean. But i use it, interceptor was not called but when i used interceptor on class level or if put @interceptors(sampleInterceptor.class) on onMessage method it's working.

Any body has any idea why interceptors is not being called when you put @interceptors(sampleInterceptor.class) on any private methods in Message driven bean?

I am using glassfish server 4.0

Was it helpful?

Solution

According to ejb3.1 specification:

Interceptor methods may be defined for business methods of sessions beans and for the message listener methods of message-driven beans.

A message listener method must follow several rules, one of them is:

The method must be declared as public.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top