File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
spring-context/src/main/java/org/springframework/context/event Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,16 @@ public void afterSingletonsInstantiated() {
75
75
String [] allBeanNames = this .applicationContext .getBeanNamesForType (Object .class );
76
76
for (String beanName : allBeanNames ) {
77
77
if (!ScopedProxyUtils .isScopedTarget (beanName )) {
78
- Class <?> type = AutoProxyUtils .determineTargetClass (this .applicationContext .getBeanFactory (), beanName );
78
+ Class <?> type = null ;
79
+ try {
80
+ type = AutoProxyUtils .determineTargetClass (this .applicationContext .getBeanFactory (), beanName );
81
+ }
82
+ catch (Throwable ex ) {
83
+ // An unresolvable bean type, probably from a lazy bean - let's ignore it.
84
+ if (logger .isDebugEnabled ()) {
85
+ logger .debug ("Could not resolve target class for bean with name '" + beanName + "'" , ex );
86
+ }
87
+ }
79
88
if (type != null ) {
80
89
if (ScopedObject .class .isAssignableFrom (type )) {
81
90
try {
@@ -107,8 +116,7 @@ public void afterSingletonsInstantiated() {
107
116
* {@link EventListener} annotated methods.
108
117
*/
109
118
protected List <EventListenerFactory > getEventListenerFactories () {
110
- Map <String , EventListenerFactory > beans =
111
- this .applicationContext .getBeansOfType (EventListenerFactory .class );
119
+ Map <String , EventListenerFactory > beans = this .applicationContext .getBeansOfType (EventListenerFactory .class );
112
120
List <EventListenerFactory > allFactories = new ArrayList <EventListenerFactory >(beans .values ());
113
121
AnnotationAwareOrderComparator .sort (allFactories );
114
122
return allFactories ;
You can’t perform that action at this time.
0 commit comments