PFA ejb3-interceptors-aop.xml
I see you have 2 custom interceptors com.mycompany.common.CustomInterceptor (client side) and com.mycompany.common.impl.ApplicationIterceptor (server side). Which one is giving you the null bean context? Can you also post the exact code from that class?
Bean context is null in Server side interceptor "ApplicationIterceptor" public class ApplicationIterceptor implements Interceptor { public Object invoke(Invocation invocation) throws Throwable { EJBContainerInvocation ejb = (EJBContainerInvocation) invocation; Principal p = ejb.getBeanContext().getEJBContext().getCallerPrincipal(); } }
//In above code ejb.getBeanContext() is null;
Looking at the order of interceptors in your -aop.xml and the code you posted, I don't see a reason why it would be null. If you have a sample application which reproduces this, please attach it here.
(So far it's just been a few snippets of code from some classes, so I can't really say whether it's a bug in your code or whether it's some config issue or it's some bug in JBoss EJB3 code).