final HashMap<Object, Object> ctx = new HashMap<Object, Object>();
ctx.put(EJB_CREATE_METHOD_KEY, ejbCreate);
ctx.put(EJB_POST_CREATE_METHOD_KEY, ejbPostCreate);
ctx.put(PARAMETERS_KEY, context.getParameters());
try {
final ManagedReference instance = view.createInstance(ctx);
return instance.getInstance();
} catch (RuntimeException e) {
//throw the correct exception type
Throwable cause = e.getCause();
if (cause instanceof CreateException) {
throw (CreateException) cause;