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.
@@ -276,12 +276,12 @@ else if (constructorToUse != null && typeDiffWeight == minTypeDiffWeight) {
276
276
throw ex ;
277
277
}
278
278
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
279
- "Could not resolve matching constructor " +
279
+ "Could not resolve matching constructor on bean class [" + mbd . getBeanClassName () + "] " +
280
280
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)" );
281
281
}
282
282
else if (ambiguousConstructors != null && !mbd .isLenientConstructorResolution ()) {
283
283
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
284
- "Ambiguous constructor matches found in bean ' " + beanName + "' " +
284
+ "Ambiguous constructor matches found on bean class [ " + mbd . getBeanClassName () + "] " +
285
285
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities): " +
286
286
ambiguousConstructors );
287
287
}
@@ -607,7 +607,7 @@ else if (resolvedValues != null) {
607
607
}
608
608
String argDesc = StringUtils .collectionToCommaDelimitedString (argTypes );
609
609
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
610
- "No matching factory method found: " +
610
+ "No matching factory method found on class [" + factoryClass . getName () + "] : " +
611
611
(mbd .getFactoryBeanName () != null ?
612
612
"factory bean '" + mbd .getFactoryBeanName () + "'; " : "" ) +
613
613
"factory method '" + mbd .getFactoryMethodName () + "(" + argDesc + ")'. " +
@@ -618,12 +618,12 @@ else if (resolvedValues != null) {
618
618
}
619
619
else if (void .class == factoryMethodToUse .getReturnType ()) {
620
620
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
621
- "Invalid factory method '" + mbd .getFactoryMethodName () +
622
- "' : needs to have a non-void return type!" );
621
+ "Invalid factory method '" + mbd .getFactoryMethodName () + "' on class [" +
622
+ factoryClass . getName () + "] : needs to have a non-void return type!" );
623
623
}
624
624
else if (ambiguousFactoryMethods != null ) {
625
625
throw new BeanCreationException (mbd .getResourceDescription (), beanName ,
626
- "Ambiguous factory method matches found in bean ' " + beanName + "' " +
626
+ "Ambiguous factory method matches found on class [ " + factoryClass . getName () + "] " +
627
627
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities): " +
628
628
ambiguousFactoryMethods );
629
629
}
0 commit comments