dromara / dromara/forest

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

Open
#181 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
241
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.