|
|
@ -440,8 +440,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
throw ex; |
|
|
|
throw ex; |
|
|
|
} |
|
|
|
} |
|
|
|
// Probably contains a placeholder: let's ignore it for type matching purposes.
|
|
|
|
// Probably contains a placeholder: let's ignore it for type matching purposes.
|
|
|
|
if (this.logger.isDebugEnabled()) { |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
this.logger.debug("Ignoring bean class loading failure for bean '" + beanName + "'", ex); |
|
|
|
logger.debug("Ignoring bean class loading failure for bean '" + beanName + "'", ex); |
|
|
|
} |
|
|
|
} |
|
|
|
onSuppressedException(ex); |
|
|
|
onSuppressedException(ex); |
|
|
|
} |
|
|
|
} |
|
|
@ -450,8 +450,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
throw ex; |
|
|
|
throw ex; |
|
|
|
} |
|
|
|
} |
|
|
|
// Probably contains a placeholder: let's ignore it for type matching purposes.
|
|
|
|
// Probably contains a placeholder: let's ignore it for type matching purposes.
|
|
|
|
if (this.logger.isDebugEnabled()) { |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
this.logger.debug("Ignoring unresolvable metadata in bean definition '" + beanName + "'", ex); |
|
|
|
logger.debug("Ignoring unresolvable metadata in bean definition '" + beanName + "'", ex); |
|
|
|
} |
|
|
|
} |
|
|
|
onSuppressedException(ex); |
|
|
|
onSuppressedException(ex); |
|
|
|
} |
|
|
|
} |
|
|
@ -521,8 +521,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
BeanCreationException bce = (BeanCreationException) rootCause; |
|
|
|
BeanCreationException bce = (BeanCreationException) rootCause; |
|
|
|
String exBeanName = bce.getBeanName(); |
|
|
|
String exBeanName = bce.getBeanName(); |
|
|
|
if (exBeanName != null && isCurrentlyInCreation(exBeanName)) { |
|
|
|
if (exBeanName != null && isCurrentlyInCreation(exBeanName)) { |
|
|
|
if (this.logger.isDebugEnabled()) { |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
this.logger.debug("Ignoring match to currently created bean '" + exBeanName + "': " + |
|
|
|
logger.debug("Ignoring match to currently created bean '" + exBeanName + "': " + |
|
|
|
ex.getMessage()); |
|
|
|
ex.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
onSuppressedException(ex); |
|
|
|
onSuppressedException(ex); |
|
|
@ -680,8 +680,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { |
|
|
|
public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { |
|
|
|
BeanDefinition bd = this.beanDefinitionMap.get(beanName); |
|
|
|
BeanDefinition bd = this.beanDefinitionMap.get(beanName); |
|
|
|
if (bd == null) { |
|
|
|
if (bd == null) { |
|
|
|
if (this.logger.isTraceEnabled()) { |
|
|
|
if (logger.isTraceEnabled()) { |
|
|
|
this.logger.trace("No bean named '" + beanName + "' found in " + this); |
|
|
|
logger.trace("No bean named '" + beanName + "' found in " + this); |
|
|
|
} |
|
|
|
} |
|
|
|
throw new NoSuchBeanDefinitionException(beanName); |
|
|
|
throw new NoSuchBeanDefinitionException(beanName); |
|
|
|
} |
|
|
|
} |
|
|
@ -725,8 +725,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void preInstantiateSingletons() throws BeansException { |
|
|
|
public void preInstantiateSingletons() throws BeansException { |
|
|
|
if (this.logger.isDebugEnabled()) { |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
this.logger.debug("Pre-instantiating singletons in " + this); |
|
|
|
logger.debug("Pre-instantiating singletons in " + this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Iterate over a copy to allow for init methods which in turn register new bean definitions.
|
|
|
|
// Iterate over a copy to allow for init methods which in turn register new bean definitions.
|
|
|
@ -813,22 +813,22 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
} |
|
|
|
} |
|
|
|
else if (oldBeanDefinition.getRole() < beanDefinition.getRole()) { |
|
|
|
else if (oldBeanDefinition.getRole() < beanDefinition.getRole()) { |
|
|
|
// e.g. was ROLE_APPLICATION, now overriding with ROLE_SUPPORT or ROLE_INFRASTRUCTURE
|
|
|
|
// e.g. was ROLE_APPLICATION, now overriding with ROLE_SUPPORT or ROLE_INFRASTRUCTURE
|
|
|
|
if (this.logger.isWarnEnabled()) { |
|
|
|
if (logger.isWarnEnabled()) { |
|
|
|
this.logger.warn("Overriding user-defined bean definition for bean '" + beanName + |
|
|
|
logger.warn("Overriding user-defined bean definition for bean '" + beanName + |
|
|
|
"' with a framework-generated bean definition: replacing [" + |
|
|
|
"' with a framework-generated bean definition: replacing [" + |
|
|
|
oldBeanDefinition + "] with [" + beanDefinition + "]"); |
|
|
|
oldBeanDefinition + "] with [" + beanDefinition + "]"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (!beanDefinition.equals(oldBeanDefinition)) { |
|
|
|
else if (!beanDefinition.equals(oldBeanDefinition)) { |
|
|
|
if (this.logger.isInfoEnabled()) { |
|
|
|
if (logger.isInfoEnabled()) { |
|
|
|
this.logger.info("Overriding bean definition for bean '" + beanName + |
|
|
|
logger.info("Overriding bean definition for bean '" + beanName + |
|
|
|
"' with a different definition: replacing [" + oldBeanDefinition + |
|
|
|
"' with a different definition: replacing [" + oldBeanDefinition + |
|
|
|
"] with [" + beanDefinition + "]"); |
|
|
|
"] with [" + beanDefinition + "]"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
if (this.logger.isDebugEnabled()) { |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
this.logger.debug("Overriding bean definition for bean '" + beanName + |
|
|
|
logger.debug("Overriding bean definition for bean '" + beanName + |
|
|
|
"' with an equivalent definition: replacing [" + oldBeanDefinition + |
|
|
|
"' with an equivalent definition: replacing [" + oldBeanDefinition + |
|
|
|
"] with [" + beanDefinition + "]"); |
|
|
|
"] with [" + beanDefinition + "]"); |
|
|
|
} |
|
|
|
} |
|
|
@ -871,8 +871,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
|
|
|
|
|
|
|
|
BeanDefinition bd = this.beanDefinitionMap.remove(beanName); |
|
|
|
BeanDefinition bd = this.beanDefinitionMap.remove(beanName); |
|
|
|
if (bd == null) { |
|
|
|
if (bd == null) { |
|
|
|
if (this.logger.isTraceEnabled()) { |
|
|
|
if (logger.isTraceEnabled()) { |
|
|
|
this.logger.trace("No bean named '" + beanName + "' found in " + this); |
|
|
|
logger.trace("No bean named '" + beanName + "' found in " + this); |
|
|
|
} |
|
|
|
} |
|
|
|
throw new NoSuchBeanDefinitionException(beanName); |
|
|
|
throw new NoSuchBeanDefinitionException(beanName); |
|
|
|
} |
|
|
|
} |
|
|
|