1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -277,12 +277,12 @@ else if (constructorToUse != null && typeDiffWeight == minTypeDiffWeight) {
277
277
throw ex ;
278
278
}
279
279
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
280
- "Could not resolve matching constructor " +
280
+ "Could not resolve matching constructor on bean class [" + mbd . getBeanClassName () + "] " +
281
281
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)" );
282
282
}
283
283
else if (ambiguousConstructors != null && !mbd .isLenientConstructorResolution ()) {
284
284
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
285
- "Ambiguous constructor matches found in bean ' " + beanName + "' " +
285
+ "Ambiguous constructor matches found on bean class [ " + mbd . getBeanClassName () + "] " +
286
286
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities): " +
287
287
ambiguousConstructors );
288
288
}
@@ -608,7 +608,7 @@ else if (resolvedValues != null) {
608
608
}
609
609
String argDesc = StringUtils .collectionToCommaDelimitedString (argTypes );
610
610
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
611
- "No matching factory method found: " +
611
+ "No matching factory method found on class [" + factoryClass . getName () + "] : " +
612
612
(mbd .getFactoryBeanName () != null ?
613
613
"factory bean '" + mbd .getFactoryBeanName () + "'; " : "" ) +
614
614
"factory method '" + mbd .getFactoryMethodName () + "(" + argDesc + ")'. " +
@@ -619,12 +619,12 @@ else if (resolvedValues != null) {
619
619
}
620
620
else if (void .class == factoryMethodToUse .getReturnType ()) {
621
621
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
622
- "Invalid factory method '" + mbd .getFactoryMethodName () +
623
- "' : needs to have a non-void return type!" );
622
+ "Invalid factory method '" + mbd .getFactoryMethodName () + "' on class [" +
623
+ factoryClass . getName () + "] : needs to have a non-void return type!" );
624
624
}
625
625
else if (ambiguousFactoryMethods != null ) {
626
626
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
627
- "Ambiguous factory method matches found in bean ' " + beanName + "' " +
627
+ "Ambiguous factory method matches found on class [ " + factoryClass . getName () + "] " +
628
628
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities): " +
629
629
ambiguousFactoryMethods );
630
630
}
0 commit comments