Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'api-host' in value "${

1问题Could not resolve placeholder 'api-host' in value :

2.解决问题:

// 设置@Value注解取值不到忽略(不报错)
  @Bean
 public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
           PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
           c.setIgnoreUnresolvablePlaceholders(true);
           return c;
          }
发布了91 篇原创文章 · 获赞 16 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/fujianmin19910915/article/details/103634596