Skip to content

Commit 6003f55

Browse files
committed
Use framework's AopProxyUtils to take care of CGLIB Proxy
Fix spring-cloudGH-1308 Signed-off-by: Yanming Zhou <[email protected]>
1 parent 2904285 commit 6003f55

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesRebinder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Set;
2222
import java.util.concurrent.ConcurrentHashMap;
2323

24+
import org.springframework.aop.framework.AopProxyUtils;
2425
import org.springframework.aop.scope.ScopedProxyUtils;
2526
import org.springframework.aop.support.AopUtils;
2627
import org.springframework.beans.BeansException;
@@ -132,7 +133,8 @@ private boolean rebind(String name, ApplicationContext appContext) {
132133
// TODO: determine a more general approach to fix this.
133134
// see
134135
// https://github.com/spring-cloud/spring-cloud-commons/issues/571
135-
if (getNeverRefreshable().contains(bean.getClass().getName()) || getNeverRefreshable().contains(name)) {
136+
Class<?> beanClass = AopProxyUtils.ultimateTargetClass(bean);
137+
if (getNeverRefreshable().contains(beanClass.getName()) || getNeverRefreshable().contains(name)) {
136138
return false; // ignore
137139
}
138140
appContext.getAutowireCapableBeanFactory().destroyBean(bean);

0 commit comments

Comments
 (0)