@ -38,6 +38,7 @@ import org.springframework.beans.BeansException;
@@ -38,6 +38,7 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.CachedIntrospectionResults ;
import org.springframework.beans.factory.BeanFactory ;
import org.springframework.beans.factory.BeanFactoryInitializer ;
import org.springframework.beans.factory.BeanNotOfRequiredTypeException ;
import org.springframework.beans.factory.NoSuchBeanDefinitionException ;
import org.springframework.beans.factory.ObjectProvider ;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory ;
@ -965,7 +966,15 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
@@ -965,7 +966,15 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
// Initialize LoadTimeWeaverAware beans early to allow for registering their transformers early.
String [ ] weaverAwareNames = beanFactory . getBeanNamesForType ( LoadTimeWeaverAware . class , false , false ) ;
for ( String weaverAwareName : weaverAwareNames ) {
beanFactory . getBean ( weaverAwareName , LoadTimeWeaverAware . class ) ;
try {
beanFactory . getBean ( weaverAwareName , LoadTimeWeaverAware . class ) ;
}
catch ( BeanNotOfRequiredTypeException ex ) {
if ( logger . isDebugEnabled ( ) ) {
logger . debug ( "Failed to initialize LoadTimeWeaverAware bean '" + weaverAwareName +
"' due to unexpected type mismatch: " + ex . getMessage ( ) ) ;
}
}
}
// Stop using the temporary ClassLoader for type matching.