OptionsLog.install();
OpenEJB.init(properties);
final ConfigurationFactory configurationFactory = new ConfigurationFactory();
final AppModule appModule = load(map, configurationFactory);
final Set<String> callers;
if (map.containsKey(OPENEJB_ADDITIONNAL_CALLERS_KEY)) {
callers = new LinkedHashSet<String>();
callers.addAll(Arrays.asList(((String) map.get(OPENEJB_ADDITIONNAL_CALLERS_KEY)).split(",")));
} else {
callers = NewLoaderLogic.callers();
}
final EjbJar ejbJar = new EjbJar();
final OpenejbJar openejbJar = new OpenejbJar();
for (String caller : callers) {
if (!isValid(caller)) continue;
final ManagedBean bean = ejbJar.addEnterpriseBean(new ManagedBean(caller, caller, true));
// set it to bean so it can get UserTransaction injection
bean.setTransactionType(TransactionType.BEAN);
final EjbDeployment ejbDeployment = openejbJar.addEjbDeployment(bean);
// important in case any other deploment id formats are specified
ejbDeployment.setDeploymentId(caller);
}
appModule.getEjbModules().add(new EjbModule(ejbJar, openejbJar));
final AppInfo appInfo;
try {
appInfo = configurationFactory.configureApplication(appModule);
} catch (ValidationFailedException e) {
logger.warning("configureApplication.loadFailed", appModule.getModuleId(), e.getMessage()); // DO not include the stacktrace in the message