try {
EJBSecurityManager sm =
EJBSecurityManager.createManager(nextDescriptor,true);
// create the bean container
Container container = null;
try {
notifyEjbEvent(EjbContainerEvent.BEFORE_EJB_CONTAINER_LOAD,
nextDescriptor);
container = cf.createContainer(nextDescriptor, loader,
sm, dynamicConfigContext);
notifyEjbEvent(EjbContainerEvent.AFTER_EJB_CONTAINER_LOAD,
nextDescriptor);
} catch (NameAlreadyBoundException jndiEx) {
// logs a message
_logger.log(Level.SEVERE, "loader.jndi_name_conflict",
new Object[] {
this.id,
nextDescriptor.getJndiName(),
nextDescriptor.getName()
});
// logs the actual exception
_logger.log(Level.SEVERE,
"loader.naming_exception_in_createcontainer", jndiEx);
// remove all loaded ejbs
unloadEjbs(jsr77);
// abort loading
return false;
}
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,
"Created container with uinque id: "
+ nextDescriptor.getUniqueId());
}
// adds the container to the repository
this.registry.addDescriptor2Container(nextDescriptor,container);
// adds the container to the temp local table
myContainers.add(container);
} catch (Exception beanEx) {
_logger.log(Level.SEVERE,
"loader.unexpected_error_while_creating_ejb_container",
beanEx);
// remove all loaded ejbs
unloadEjbs(jsr77);
return false;
}
if (jsr77) {
try {
createLeafMBean(nextDescriptor);
} catch (MBeanException mbe) {
_logger.log(Level.WARNING, "loader.create_ejb_mbean_exception", mbe);
}
}
}
try {
Enumeration en = beanDescriptors.elements();
// generate policy files for applications with ejbs not otherwise
while (en.hasMoreElements()) {
EjbDescriptor nextDescriptor = (EjbDescriptor)en.nextElement();
SecurityUtil.generatePolicyFile(
EJBSecurityManager.getContextID(nextDescriptor));
}
} catch (Exception ge) {
_logger.log(Level.SEVERE,
"code.could_not_generate/load_the_policy_files_for_system_app",
ge);
// remove all loaded ejbs
unloadEjbs(jsr77);
return false;
}
//START CR 6653050
//initialize webservice enpoints
Iterator ec = myContainers.iterator();
while(ec.hasNext()) {
try {
BaseContainer c = (BaseContainer)ec.next();
c.initializeWebService();
} catch (Exception exce) {
_logger.log(Level.SEVERE,
"loader.unexpected_error_while_creating_ejb_container", exce);
// remove all loaded ejbs
unloadEjbs(jsr77);
return false;
}
}
//END CR 6653050
// notify ejb containers that application deployment succeeded.
Iterator iter = myContainers.iterator();
while ( iter.hasNext() ) {
Container c = (Container) iter.next();
c.doAfterApplicationDeploy();
//IASRI 4717059 BEGIN
/*
if (robFlag) {
if ( c instanceof EntityContainer) {
( (EntityContainer) c).setROBNotifier(robNotifier);