报错:org.springframework.beans.factory.BeanCreationException: Error creating bean wIth name 'userController': Injection of autowired dependencies failed; nested exception is java.lang.llegaLArgumentexceptton: Could not resolve placeholder 'pattern.dateformat in value "${pattern.dateformat}"
Spring: 2.3.9
Nacos: 1.4.1
idea: 2023.3.4
查到好几种解决方案:
方案一:@Value("${pattern.dateformat}")改为@Value("${logging.pattern.dateformat}") ,对我有效
方案二:@Value改为@NacosValue,尝试之后问题变成空指针异常,在Controller类加上@RefreshScope,依旧报错
方案三:@Value("${pattern.dateformat}")改为@Value("${pattern:dateformat}"),无效
补充:
Spring3对bootstrap.xml没有优先,需要引入依赖(不确定,没尝试过)