File tree 1 file changed +10
-1
lines changed
spring-context/src/main/java/org/springframework/context/support
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 36
36
import org .springframework .beans .BeansException ;
37
37
import org .springframework .beans .CachedIntrospectionResults ;
38
38
import org .springframework .beans .factory .BeanFactory ;
39
+ import org .springframework .beans .factory .BeanNotOfRequiredTypeException ;
39
40
import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
40
41
import org .springframework .beans .factory .ObjectProvider ;
41
42
import org .springframework .beans .factory .config .AutowireCapableBeanFactory ;
@@ -949,7 +950,15 @@ protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory b
949
950
// Initialize LoadTimeWeaverAware beans early to allow for registering their transformers early.
950
951
String [] weaverAwareNames = beanFactory .getBeanNamesForType (LoadTimeWeaverAware .class , false , false );
951
952
for (String weaverAwareName : weaverAwareNames ) {
952
- beanFactory .getBean (weaverAwareName , LoadTimeWeaverAware .class );
953
+ try {
954
+ beanFactory .getBean (weaverAwareName , LoadTimeWeaverAware .class );
955
+ }
956
+ catch (BeanNotOfRequiredTypeException ex ) {
957
+ if (logger .isDebugEnabled ()) {
958
+ logger .debug ("Failed to initialize LoadTimeWeaverAware bean '" + weaverAwareName +
959
+ "' due to unexpected type mismatch: " + ex .getMessage ());
960
+ }
961
+ }
953
962
}
954
963
955
964
// Stop using the temporary ClassLoader for type matching.
You can’t perform that action at this time.
0 commit comments