nacos启动报错信息
1 | ERROR Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. <br>Message: Error creating bean with name 'basicAuthenticationFilter' defined in class path resource <br>[com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter. class ]: Unsatisfied dependency expressed through method 'basicAuthenticationFilter' parameter 0 ; <br>nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthConfig' <br>defined in URL [jar:file:/D:/all_software/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-plugin- default -impl- 2.2 . 1 .jar!<br>/com/alibaba/nacos/plugin/auth/impl/NacosAuthConfig. class ]: Unsatisfied dependency expressed through constructor parameter 1 ; <br>nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tokenManagerDelegate' : <br>Unsatisfied dependency expressed through field 'jwtTokenManager' ; nested exception is org.springframework.beans.factory.BeanCreationException: <br>Error creating bean with name 'jwtTokenManager' defined in URL [jar:file:/D:/all_software/nacos/target/nacos-server.jar<br>!/BOOT-INF/lib/nacos-plugin- default -impl- 2.2 . 1 .jar!/com/alibaba/nacos/plugin/auth/impl/token/impl/JwtTokenManager. class ]: <br>Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate <br>[com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: <br>the length of secret key must great than or equal 32 bytes; And the secret key must be encoded by base64.Please see <br>https: //nacos.io/zh-cn/docs/v2/guide/user/auth.html |
原因:
缺少配置了nacos.core.auth.plugin.nacos.token.secret.key
解决方案:
找到文件application.properties,编辑填写一下内容
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律