} else {
logger.error("Jndi(name=" + externalName +") cannot be bound to Ejb(deployment-id="+beanInfo.ejbDeploymentId+"). Name already taken by another object in the system.");
}
// Construct a new exception as the IvmContext doesn't include
// the name in the exception that it throws
if (failOnCollision) throw new NameAlreadyBoundException(externalName);
}
} else {
try {
context.bind(name, ref);
bindings.add(name);
} catch (NameAlreadyBoundException e) {
logger.error("Jndi name could not be bound; it may be taken by another ejb. Jndi(name=" + name +")");
// Construct a new exception as the IvmContext doesn't include
// the name in the exception that it throws
throw new NameAlreadyBoundException(name);
}
}
}