Backported exception message refinements from 4.2.x
This commit is contained in:
@@ -331,7 +331,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||
String scopeName = mbd.getScope();
|
||||
final Scope scope = this.scopes.get(scopeName);
|
||||
if (scope == null) {
|
||||
throw new IllegalStateException("No Scope registered for scope '" + scopeName + "'");
|
||||
throw new IllegalStateException("No Scope registered for scope name '" + scopeName + "'");
|
||||
}
|
||||
try {
|
||||
Object scopedInstance = scope.get(beanName, new ObjectFactory<Object>() {
|
||||
@@ -350,8 +350,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
throw new BeanCreationException(beanName,
|
||||
"Scope '" + scopeName + "' is not active for the current thread; " +
|
||||
"consider defining a scoped proxy for this bean if you intend to refer to it from a singleton",
|
||||
"Scope '" + scopeName + "' is not active for the current thread; consider " +
|
||||
"defining a scoped proxy for this bean if you intend to refer to it from a singleton",
|
||||
ex);
|
||||
}
|
||||
}
|
||||
@@ -1334,6 +1334,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||
|
||||
private Class<?> doResolveBeanClass(RootBeanDefinition mbd, Class<?>... typesToMatch) throws ClassNotFoundException {
|
||||
if (!ObjectUtils.isEmpty(typesToMatch)) {
|
||||
// When just doing type checks (i.e. not creating an actual instance yet),
|
||||
// use the specified temporary class loader (e.g. in a weaving scenario).
|
||||
ClassLoader tempClassLoader = getTempClassLoader();
|
||||
if (tempClassLoader != null) {
|
||||
if (tempClassLoader instanceof DecoratingClassLoader) {
|
||||
|
||||
Reference in New Issue
Block a user