factoryBean.setServiceProperties(getServiceProperties(service));
factoryBean.setInterfaces(interfaces);
factoryBean.setBeanFactory(applicationContext);
factoryBean.setTargetBeanName(beanName);
factoryBean.setBundleContext(bundleContext);
factoryBean.afterPropertiesSet();
} catch (final Exception e) {
logger.warn("Error registering bean '{}' as OSGi service.", beanName, e);
}
}