If you look at the bolded code in EJBInvocationHandler:
Object doInvoke(final T proxy, final Method method, final Object[] args) throws Throwable {
final MethodHandler handler = clientSideMethods.get(new MethodKey(method));
if (handler != null && handler.canHandleInvocation(this, proxy, method, args)) {
return handler.invoke(this, proxy, method, args);
}
final EJBClientContext context = EJBClientContext.requireCurrent();
return doInvoke(this, async, proxy, method, args, context);
}
EJBClientContext is using a non-thread local static. I don't know how to make that thread safe with the above suggestions. Looking forward to hearing from you.