From fc5e3d64418b6bf274e5124a13b797886d3fa5fc Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 30 Nov 2015 09:49:47 +0100 Subject: [PATCH] Refine exception message Closes gh-4569 --- .../autoconfigure/condition/SpringBootCondition.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java index 7da1f5e1ee..c93810b189 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java @@ -51,10 +51,11 @@ public abstract class SpringBootCondition implements Condition { } catch (NoClassDefFoundError ex) { throw new IllegalStateException("Could not evaluate condition on " - + classOrMethodName + " due to internal class not found. " - + "This can happen if you are @ComponentScanning a " - + "springframework package (e.g. if you put a @ComponentScan " - + "in the default package by mistake)", ex); + + classOrMethodName + " due to " + ex.getMessage() + " not " + + "found. Make sure your own configuration does not rely on " + + "that class. This can also happen if you are " + + "@ComponentScanning a springframework package (e.g. if you " + + "put a @ComponentScan in the default package by mistake)", ex); } catch (RuntimeException ex) { throw new IllegalStateException(