在GitHub上下了一个Nacos的2.2.0.1版本,直接解压,安装到本地,启动服务失败。。what??
查看了一下报错信息,它给了提示,去这个网站(https://nacos.io/zh-cn/docs/v2/guide/user/auth.html)查看一下原因。
UnsatisfiedDependencyException: Error creating bean with name 'user': Unsatisfied dependency expressed through field 'jwtTokenManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtTokenManager' defined in URL [jar:file:/D:/nacos-server-2.2.0.1/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-plugin-default-impl-2.2.0.jar!/com/alibaba/nacos/plugin/auth/impl/JwtTokenManager.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.plugin.auth.impl.JwtTokenManager]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: the length of secret key must great than or equal 32 bytes; And the secret key must be encoded by base64.Please see https://nacos.io/zh-cn/docs/v2/guide/user/auth.html
-
官网给的提示是,在2.2.0.1版本之后,不提供以下的默认值了。
-
然后我就去本地的application.properties看了一下,果然是空的!一阵操作,给他补上
这里官网给了示例,我就直接按照他给的示例做了密钥填充。修改前:
修改后:
文章来源:https://www.toymoban.com/news/detail-593223.html -
再进入到nacos的bin目录下,打开cmd窗口,使用 startup.cmd -m standalone 命令,以单机模式运行,成功!在浏览器中输入 localhost:8848/nacos进行登录,用户名和密码都是nacos
文章来源地址https://www.toymoban.com/news/detail-593223.html
到了这里,关于Nacos 2.2.0.1启动服务失败, 提示Error creating bean with name ‘user‘:的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!