Open shining-stars-lk opened 5 months ago
<dependency> <groupId>com.alibaba.boot</groupId> <artifactId>nacos-config-spring-boot-starter</artifactId> <version>0.2.5</version> </dependency>
nacos: config: bootstrap: enable: true server-addr: xxx:8848 data-id: web-mdt.yaml namespace: xxx group: mdt_group type: yaml auto-refresh: true username: nacos password: nacos ext-config: - server-addr: xxx:8848 data-id: web-mdt-company.yaml namespace: xxx group: mdt_group type: yaml auto-refresh: true username: nacos password: nacos
在项目启动时,出现了类找不到错误
web- 2024-04-07 13:51:15 [restartedMain] ERROR o.s.boot.SpringApplication - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nacosConfigurationPropertiesBinder': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.boot.nacos.config.binder.NacosBootConfigurationPropertiesBinder]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
这是什么原因?
版本不兼容,建议降低SpringBoot的版本至2.4以下,或者升级Nacos的版本至0.2.12 https://github.com/alibaba/nacos/issues/4554 https://github.com/nacos-group/nacos-spring-boot-project/issues/159
SpringBoot
2.4
Nacos
0.2.12
版本
引入的Nacos依赖:
读取的相关配置
出现的错误
在项目启动时,出现了类找不到错误
这是什么原因?