ctx.push(instance);
ProxyFactory.setBeanInstance(bean.getBeanManager().getContextId(), instance, createEnterpriseTargetBeanInstance(), bean);
return instance;
} catch (PrivilegedActionException e) {
if (e.getCause() instanceof InstantiationException) {
throw new WeldException(BeanLogger.LOG.proxyInstantiationFailed(this), e.getCause());
} else if (e.getCause() instanceof IllegalAccessException) {
throw new WeldException(BeanLogger.LOG.proxyInstantiationBeanAccessFailed(this), e.getCause());
} else {
throw new WeldException(e.getCause());
}
} catch (Exception e) {
throw BeanLogger.LOG.ejbNotFound(proxyClass, e);
}
}