@Value not resolved when using @PropertySource annotation. How to configure PropertySourcesPlaceholderConfigurer?

前端 未结 11 1184
情深已故
情深已故 2020-11-28 23:11

I have following configuration class:

@Configuration
@PropertySource(name = \"props\", value = \"classpath:/app-config.properties\")
@ComponentScan(\"service         


        
11条回答
  •  天涯浪人
    2020-11-28 23:39

    In my case, depends-on="bean1" was within property-placeholder was causing the issue. I removed that dependency and used @PostConstruct to achieve the same original functionality and was able to read the new values too.

提交回复
热议问题