nocas配置加载失败解决-笔记

nacos配置加载失败问题-笔记


各位遇到的问题不尽相同,本文只记录 自己 遇到的问题并及如何解决

背景

最近接手的一个微服务架构项目,同事搭建的框架,按照配置一步一步搬运到nacos上,本地启动测试通过,满心欢喜部署开发环境,结果发现报没有配置mysql的url属性错误。

解决过程

  1. 报错信息明显是配置没加载成功导致的,于是乎各种尝试排查。
  2. 最后在启动日志上看到一个警告AutoProxyRegistrar was imported but no annotations were found having both 'mode' and 'proxyTargetClass' attributes of type AdviceMode and boolean respectively. This means that auto proxy creator registration and configuration may not have occurred as intended, and components may not be proxied as expected. Check to ensure that AutoProxyRegistrar has been @Import'ed on the same class where these annotations are declared; otherwise remove the import of AutoProxyRegistrar altogether.
    于是乎拍了下大腿,nacos是通过动态代理实现的配置加载

解决方案

在启动类上加上注解@EnableAspectJAutoProxy,再次部署完美启动。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值