mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Log load bean exception (#6356)
* Log load bean exception * Address review * import BeansException Co-authored-by: João Paraquetti <joao@scclouds.com.br>
This commit is contained in:
parent
5fdd4d211d
commit
ffc914d846
@ -31,6 +31,7 @@ import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@ -72,8 +73,14 @@ public class ComponentContext implements ApplicationContextAware {
|
||||
|
||||
Map<String, ComponentMethodInterceptable> interceptableComponents = getApplicationContext().getBeansOfType(ComponentMethodInterceptable.class);
|
||||
for (Map.Entry<String, ComponentMethodInterceptable> entry : interceptableComponents.entrySet()) {
|
||||
Object bean = getTargetObject(entry.getValue());
|
||||
beanFactory.configureBean(bean, entry.getKey());
|
||||
try {
|
||||
Object bean = getTargetObject(entry.getValue());
|
||||
beanFactory.configureBean(bean, entry.getKey());
|
||||
} catch (BeansException e){
|
||||
s_logger.error(String.format("Could not load bean due to: [%s]. The service will be stopped. Please investigate the cause of the error or contact your support team.", e.getMessage()), e);
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Map<String, ComponentLifecycle> lifecycleComponents = getApplicationContext().getBeansOfType(ComponentLifecycle.class);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user