From 37f4f43726d1f7f4c2a7d6e192a1fa96d0efd810 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 7 Nov 2016 19:13:00 +0100 Subject: [PATCH] Consistent 4.x style NoClassDefFoundError handling Issue: SPR-14883 --- .../annotation/AutowiredAnnotationBeanPostProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java index fe4d2202a9..a21c0f899e 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java @@ -265,6 +265,10 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean catch (IllegalStateException ex) { throw new BeanCreationException(beanName, "Lookup method resolution failed", ex); } + catch (NoClassDefFoundError err) { + throw new BeanCreationException(beanName, "Failed to introspect bean class [" + beanClass.getName() + + "] for lookup method metadata: could not find class that it depends on", err); + } this.lookupMethodsChecked.add(beanName); }