Nacos启动异常与SpringBoot整合异常的问题及解决

 更新时间:2025年08月25日 08:58:33   作者:我自是年少韶华倾负  
文章介绍了Nacos启动异常和SpringBoot整合报错的两种问题:启动异常可通过指定启动命令或删除data目录内容解决;整合报错因版本不匹配,需将nacos-discovery升级至2.2.7.RELEASE以适配2.0.3注册中心版本

nacos启动异常

问题描述:

Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.FilterRegistrationBean]: Factory method 'authFilterRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter': Unsatisfied dependency expressed through field 'authManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthManager': Unsatisfied dependency expressed through field 'authenticationManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosUserDetailsServiceImpl': Unsatisfied dependency expressed through field 'userPersistService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'externalUserPersistServiceImpl': Unsatisfied dependency expressed through field 'persistService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalStoragePersistServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error]load jdbc.properties error

解决办法:

  • 启动时使用 如下命令
startup.cmd -m standalone
  • 如果还是启动报错就尝试删除
  • data 文件夹下的内容 重启Nacos

与SpringBoot整合报错

问题描述:

nacosProperties (field private java.util.Optional com.alibaba.cloud.nacos.NacosDiscoveryProperties.nacosAutoServiceRegistrationOptional)

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main

报错版本:

  • nacos 注册中心版本为2.0.3 
  • nacos-discovery 为 2.2.2.RElEASE 

修改方法:

  • 升级nacos-discovery 版本到 2.2.7.RELEASE

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

相关文章

  • Java中数组转换为列表的两种实现方式(超简单)

    Java中数组转换为列表的两种实现方式(超简单)

    本文介绍了在Java中将数组转换为列表的两种常见方法使用Arrays.asList和Java8的Stream API,Arrays.asList方法简单易用,但返回的列表是固定大小的;而使用Stream API可以实现更灵活的操作,如过滤和映射,根据具体需求选择合适的方法,感兴趣的朋友一起看看吧
    2025-03-03
  • Token登陆验证机制的原理及实现

    Token登陆验证机制的原理及实现

    这篇文章介绍了Token登陆验证机制的原理及实现,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2021-12-12
  • 关于springboot配置文件密文解密方式

    关于springboot配置文件密文解密方式

    这篇文章主要介绍了关于springboot配置文件密文解密方式,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-08-08
  • 详解Spring中使用@within与@target的区别

    详解Spring中使用@within与@target的区别

    这篇文章主要介绍了Spring中使用@within与@target的一些区别,本文通过项目案例给大家详细分析,给大家介绍的非常详细,代码简单易懂,需要的朋友可以参考下
    2021-09-09
  • java中 == 与 equal 的区别讲解

    java中 == 与 equal 的区别讲解

    这篇文章介绍了java中 == 与 equal 的区别,有需要的朋友可以参考一下
    2013-10-10
  • 解决SpringBoot项目读取yml文件中值为中文时,在视图页面显示乱码

    解决SpringBoot项目读取yml文件中值为中文时,在视图页面显示乱码

    这篇文章主要介绍了解决SpringBoot项目读取yml文件中值为中文时,在视图页面显示乱码的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2023-08-08
  • Java JDK 二分法 分析demo(推荐)

    Java JDK 二分法 分析demo(推荐)

    下面小编就为大家带来一篇Java JDK 二分法 分析demo(推荐)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-07-07
  • Spring中的@ControllerAdvice三种用法详解

    Spring中的@ControllerAdvice三种用法详解

    这篇文章主要介绍了Spring中的@ControllerAdvice三种用法详解,加了@ControllerAdvice的类为那些声明了(@ExceptionHandler、@InitBinder或@ModelAttribute注解修饰的)方法的类而提供的<BR>专业化的@Component,以供多个Controller类所共享,需要的朋友可以参考下
    2024-01-01
  • 关于JSqlparser使用攻略(高效的SQL解析工具)

    关于JSqlparser使用攻略(高效的SQL解析工具)

    这篇文章主要介绍了关于JSqlparser使用攻略(高效的SQL解析工具),具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-11-11
  • java如何从linux服务器下载文件

    java如何从linux服务器下载文件

    这篇文章主要介绍了java如何从linux服务器下载文件,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-01-01

最新评论