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

作者 : admin 本文共682个字,预计阅读时间需要2分钟 发布时间: 2024-06-10 共2人阅读

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,再次部署完美启动。

本站无任何商业行为
个人在线分享 » nocas配置加载失败解决-笔记
E-->