Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Springboot集成Nacos配置中心报错 #328

Open
shining-stars-lk opened this issue Apr 7, 2024 · 0 comments
Open

Springboot集成Nacos配置中心报错 #328

shining-stars-lk opened this issue Apr 7, 2024 · 0 comments

Comments

@shining-stars-lk
Copy link

版本

  • SpringBoot:2.5.2
  • Nacos:0.2.5

引入的Nacos依赖:

<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

这是什么原因?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant