使用@RefreshScope时报错,服务无法启动
heyijx2 opened this issue · 0 comments
问题:有个环境变量写在nacos中mytest.host,想让其支持动态更新,所以interface上加了@RefreshScope,结果服务报错无法启动
请求:或者有其他方式能支持动态更新吗?
详情:
@BaseRequest(baseURL = "#{mytest.host}")
@RefreshScope
public interface SonicClient {
}
报错信息:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'forestBeanRegister' defined in class path resource [com/dtflys/forest/springboot/ForestAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.dtflys.forest.springboot.ForestBeanRegister]: Factory method 'forestBeanRegister' threw exception; nested exception is java.lang.ClassCastException: org.springframework.beans.factory.support.RootBeanDefinition cannot be cast to org.springframework.beans.factory.support.GenericBeanDefinition