Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用@RefreshScope时报错,服务无法启动 #181

Open
heyijx2 opened this issue Dec 26, 2023 · 0 comments
Open

使用@RefreshScope时报错,服务无法启动 #181

heyijx2 opened this issue Dec 26, 2023 · 0 comments

Comments

@heyijx2
Copy link

heyijx2 commented Dec 26, 2023

问题:有个环境变量写在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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant