标签:技术 exception not 链接 src factor gets common sse
Java链接Redis时出现 “ERR Client sent AUTH, but no password is set” 异常的原因及解决办法
【错误提示】
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the poolat redis.clients.util.Pool.getResource(Pool.java:53)
at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226)
at cn.hncu.RedisPool.getJedis(RedisPool.java:66)
at cn.hncu.RedisJava.main(RedisJava.java:15)
Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is setat redis.clients.jedis.Protocol.processError(Protocol.java:127)
at redis.clients.jedis.Protocol.process(Protocol.java:161)at redis.clients.jedis.Protocol.read(Protocol.java:215)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239)
at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2139)
at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:108)
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868)
【问题原因】
Redis服务器没有设置密码,但客户端向其发送了AUTH(authentication,身份验证)请求。
【解决办法】
确定Redis启动时指定是哪个配置文件。
如上图是 redis.windows.conf 文件,用文本编辑工具打开文件,找到“requirepass”,去掉注释设置密码。
编辑完后保存,重新启动Redis,再运行程序,OK。
Java链接Redis时出现 “ERR Client sent AUTH, but no password is set”
标签:技术 exception not 链接 src factor gets common sse
原文地址:https://www.cnblogs.com/lwcode6/p/11576721.html