nacos-group / nacos-spring-project

Nacos ECO Project for Spring Framework
https://nacos.io/
Apache License 2.0
756 stars 311 forks source link

配置文件不能动态的指定每个配置文件的type,在配置文件中通过data-ids的后缀名作为dataid的类型,不指定type,启动的时候会有null的报错 #201

Closed lfc8912 closed 4 years ago

lfc8912 commented 4 years ago

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

  1. application.yml配置如下

    nacos配置

    nacos: config: server-addr: 127.0.0.1:8848 data-ids: com.nacos.test.yml,com.nacos.test.mutl.yml autoRefresh: true bootstrap: log-enable: true

  2. 启动springboot工程报错如下: java.lang.NullPointerException: null at com.alibaba.boot.nacos.config.util.NacosConfigLoader.reqNacosConfig(NacosConfigLoader.java:164) ~[nacos-config-spring-boot-autoconfigure-0.2.7.jar:0.2.7] at com.alibaba.boot.nacos.config.util.NacosConfigLoader.reqGlobalNacosConfig(NacosConfigLoader.java:127) ~[nacos-config-spring-boot-autoconfigure-0.2.7.jar:0.2.7] at com.alibaba.boot.nacos.config.util.NacosConfigLoader.loadConfig(NacosConfigLoader.java:67) ~[nacos-config-spring-boot-autoconfigure-0.2.7.jar:0.2.7] at com.alibaba.boot.nacos.config.autoconfigure.NacosConfigEnvironmentProcessor.loadConfig(NacosConfigEnvironmentProcessor.java:94) ~[nacos-config-spring-boot-autoconfigure-0.2.7.jar:0.2.7] at com.alibaba.boot.nacos.config.autoconfigure.NacosConfigEnvironmentProcessor.postProcessEnvironment(NacosConfigEnvironmentProcessor.java:87)

Tell us your environment

springboot-2.2.4 +nacos-config-spring-boot-starter-0.2.7

Anything else we need to know?