在seata使用nacos配置中心进行配置的时候, seata日志里会一直报错:
c.a.nacos.client.security.SecurityProxy : [SecurityProxy] login http request failed url: http://192.168.119.128:8848/nacos/v1/auth/users/login, params: {username=nacos}, bodyMap: {password=nacos}, errorMsg: Server returned HTTP response code: 500 for URL:
查看nacos运行日志 发现日志一直报这个错误:
java.lang.NullPointerException: null
at com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager.getTokenTtlInSeconds(JwtTokenManager.java:150)
at com.alibaba.nacos.plugin.auth.impl.token.TokenManagerDelegate.getTokenTtlInSeconds(TokenManagerDelegate.java:89)
和这个错误:
org.springframework.security.core.userdetails.UsernameNotFoundException: nacos
at....
原因:
新版nacos默认不开启登录验证
解决方案:
1. nacos开启登录验证 改成true
### If turn on auth system:
nacos.core.auth.enabled=true
或者
2. 在seata中把用户名密码注释掉