hi, when i set annotaion @RefreshScope on bean annotated with @Bean,then i used this bean and get final funciton return value, it's get null, why?
Sample
@Bean
@RefreshScope
public StudentQueryService studentQueryService(){
return new StudentQueryService("studentName");
}
public StudentQueryService {
private String name;
public StudentQueryService (String name){
this.name = name;
}
public final getName(){
return name;
}
}
@RestController
public StudentQueryController {
@Resouce
private StudentQueryService service;
@GetMapping("/getStuName")
public String getStuName(){
return service.getName();
}
}
when request /getStuName , it's return null . But when i remove @RefreshScope , it's normal.
Comment From: OLPMO
Could you provide a complete, minimal, verifiable sample that reproduces the problem?@pizhaojun
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.