spring-cloud读取Nacos上的配置

报错信息

java 复制代码
20:06:44.599 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -- 

***************************
APPLICATION FAILED TO START
***************************

Description:

Config data resource 'file [nacos:service-order.properties]' via location 'nacos:service-order.properties' does not exist

Action:

Check that the value 'nacos:service-order.properties' at class path resource [application.properties] - 12:22 is correct, or prefix it with 'optional:'


Process finished with exit code 1

因为没有在依赖中加入如下config个依赖信息:

XML 复制代码
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>

加入如上依赖,刷新pom.

相关推荐
wand codemonkey13 小时前
SpringbootWeb【入门】+MySQL【安装】+【DataDrip安装 】+【连接MySQL】
java·mysql·mybatis
Mahir0821 小时前
Spring 循环依赖深度解密:从问题本质到三级缓存源码级解析
java·后端·spring·缓存·面试·循环依赖·三级缓存
RyFit1 天前
SpringAI 常见问题及解决方案大全
java·ai
石山代码1 天前
C++ 内存分区 堆区
java·开发语言·c++
绝知此事1 天前
【算法突围 01】线性结构与哈希表:后端开发的收纳术
java·数据结构·算法·面试·jdk·散列表
无风听海1 天前
C# 隐式转换深度解析
java·开发语言·c#
一只大袋鼠1 天前
Git 进阶(二):分支管理、暂存栈、远程仓库与多人协作
java·开发语言·git
德思特1 天前
从 Dify 配置页理解 RAG 的重要参数
java·人工智能·llm·dify·rag
YOU OU1 天前
Spring IoC&DI
java·数据库·spring
один but you1 天前
从可变参数到 emplace:现代 C++ 性能优化的核心组合
java·开发语言