try {
if (bean.isLocalbean()) {
Class beanClass = bean.getBeanClass();
BeanContext.BusinessLocalBeanHome home = bean.getBusinessLocalBeanHome();
BusinessLocalBeanReference ref = new BusinessLocalBeanReference(home);
optionalBind(bindings, ref, "openejb/Deployment/" + format(bean.getDeploymentID(), beanClass.getName(), InterfaceType.LOCALBEAN));
String internalName = "openejb/Deployment/" + format(bean.getDeploymentID(), beanClass.getName(), InterfaceType.BUSINESS_LOCALBEAN_HOME);
bind(internalName, ref, bindings, beanInfo, beanClass);