Skip to content

Commit b731f7a

Browse files
committed
ObjenesisCglibAopProxy catches NoClassDefFoundError as well
Issue: SPR-13131
1 parent 9dea9d5 commit b731f7a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/ObjenesisCglibAopProxy.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.springframework.cglib.proxy.Callback;
2323
import org.springframework.cglib.proxy.Enhancer;
2424
import org.springframework.cglib.proxy.Factory;
25-
import org.springframework.objenesis.ObjenesisException;
2625
import org.springframework.objenesis.ObjenesisStd;
2726

2827
/**
@@ -60,7 +59,7 @@ protected Object createProxyClassAndInstance(Enhancer enhancer, Callback[] callb
6059
try {
6160
proxyInstance = this.objenesis.newInstance(proxyClass);
6261
}
63-
catch (ObjenesisException ex) {
62+
catch (Throwable ex) {
6463
logger.debug("Unable to instantiate proxy using Objenesis, " +
6564
"falling back to regular proxy construction", ex);
6665
}
@@ -72,7 +71,7 @@ protected Object createProxyClassAndInstance(Enhancer enhancer, Callback[] callb
7271
proxyClass.getConstructor(this.constructorArgTypes).newInstance(this.constructorArgs) :
7372
proxyClass.newInstance());
7473
}
75-
catch (Exception ex) {
74+
catch (Throwable ex) {
7675
throw new AopConfigException("Unable to instantiate proxy using Objenesis, " +
7776
"and regular proxy instantiation via default constructor fails as well", ex);
7877
}

0 commit comments

Comments
 (0)