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 38
38
import org .springframework .beans .CachedIntrospectionResults ;
39
39
import org .springframework .beans .factory .BeanFactory ;
40
40
import org .springframework .beans .factory .BeanFactoryInitializer ;
41
+ import org .springframework .beans .factory .BeanNotOfRequiredTypeException ;
41
42
import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
42
43
import org .springframework .beans .factory .ObjectProvider ;
43
44
import org .springframework .beans .factory .config .AutowireCapableBeanFactory ;
@@ -965,7 +966,15 @@ protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory b
965
966
// Initialize LoadTimeWeaverAware beans early to allow for registering their transformers early.
966
967
String [] weaverAwareNames = beanFactory .getBeanNamesForType (LoadTimeWeaverAware .class , false , false );
967
968
for (String weaverAwareName : weaverAwareNames ) {
968
- beanFactory .getBean (weaverAwareName , LoadTimeWeaverAware .class );
969
+ try {
970
+ beanFactory .getBean (weaverAwareName , LoadTimeWeaverAware .class );
971
+ }
972
+ catch (BeanNotOfRequiredTypeException ex ) {
973
+ if (logger .isDebugEnabled ()) {
974
+ logger .debug ("Failed to initialize LoadTimeWeaverAware bean '" + weaverAwareName +
975
+ "' due to unexpected type mismatch: " + ex .getMessage ());
976
+ }
977
+ }
969
978
}
970
979
971
980
// Stop using the temporary ClassLoader for type matching.
You can’t perform that action at this time.
0 commit comments