• Linux 环境下 Nacos2.2.1启动报错


    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.plugin.auth.impl.token.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
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1326)
        ... 110 common frames omitted
    Caused by: 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
        at com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager.processProperties(JwtTokenManager.java:73)
        at com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager.(JwtTokenManager.java:61)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
        ... 112 common frames omitted
    Caused by: java.lang.IllegalArgumentException: The specified key byte array is 0 bits which is not secure enough for any JWT HMAC-SHA algorithm.  The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HMAC-SHA algorithms MUST have a size >= 256 bits (the key size must be greater than or equal to the hash output size).  See https://tools.ietf.org/html/rfc7518#section-3.2 for more information.
        at com.alibaba.nacos.plugin.auth.impl.jwt.NacosJwtParser.(NacosJwtParser.java:56)
        at com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager.processProperties(JwtTokenManager.java:71)
        ... 118 common frames omitted

    解决:

  • 相关阅读:
    LeetCode 四数相加II 哈希
    力扣第36天----第518题、第377题
    MySQL的存储引擎
    LabVIEW基础-VI Scripting
    Spring Data【Spring Data 介绍、Spring Data JPA 、Spring Data JDB】(一)-全面详解(学习总结---从入门到深化)
    Allure精通指南(02)Mac和Windows系统环境配置
    第十三届 Java B 组省赛 D 题—— 最少刷题数(AC)
    NC20566 [SCOI2010]游戏
    智能制造存在哪些难点?如何去解决?
    微信小程序custom-tab-bar
  • 原文地址:https://blog.csdn.net/zl570932980/article/details/132818605