package testapp; import javax.ejb.EJB; import javax.interceptor.AroundInvoke; import javax.interceptor.InvocationContext; public class TestInterceptor { @EJB(name = "ssBean2") private ssBean2Remote ssBean2; @AroundInvoke public Object myCheck(InvocationContext context) throws Exception { //this line will thrown a NPE if the EJB reference is ssBean2.printMessage(); return context.proceed(); } }