Context ejbContext = getInitialContext(props);
if (ejbContext == null) {
Message mg = new Message("Can't get InitialContext", LOG);
throw new BusException(mg);
}
EJBHome home = getEJBHome(ejbContext, jndiLookup);
// ejbHomeClassLoader = home.getClass().getClassLoader();
Method createMethod = home.getClass().getMethod("create", new Class[0]);
ejb = (EJBObject) createMethod.invoke(home, new Object[0]);
} catch (NamingException e) {
throw new BusException(e);
} catch (NoSuchMethodException e) {
throw new BusException(e);
} catch (IllegalAccessException e) {
throw new BusException(e);
} catch (InvocationTargetException itex) {
Throwable thrownException = itex.getTargetException();
throw new BusException(thrownException);
}
}
return ejb;
}