本地启动可以读取到nacos配置,但是发布到服务器上时获取不到nacos配置

【问题描述】

微服务发布到服务器上时获取不到nacos配置,启动工程报错:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ssoConfig': Injection of autowired dependencies failed;
nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'sso.server.url' in value "${sso.server.url}"

【原因分析】

其实,这是一个很简单的问题,主要是在.gitlab-ci.yml配置文件中,namespace与nacos上面的命名空间ID保持一致!

 

posted @ 2023-08-24 18:02  勇敢-的心  阅读(958)  评论(0)    收藏  举报