2014-05-14 156 views
1

後,我配置了密碼保護的Redis我得到以下錯誤NOAUTH需要驗證

Exception Occured 
Exception Message --> NOAUTH Authentication required. 
Exception Cause --> redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required. 
File Name : SecurityInterceptor.java  
Class Name : org.tcs.com.security.filter.SecurityInterceptor 
Method Name : doFilter 

回答

1

密碼屬性添加到您的Tomcat的context.xml塊..

2

redis.clients.jedis .exceptions.JedisDataException

表示jedis(一個Java Redis的客戶端)用於連接與Redis服務器。

「NOAUTH需要驗證錯誤」

表明jedis連接需要驗證密碼。

下面的Java代碼片斷顯示密碼是如何被設置:

JedisShardInfo shardInfo = new JedisShardInfo(redisHost, redisPort); 
shardInfo.setPassword(redisPassword); 
Jedis jedis = new Jedis(shardInfo); 
jedis.connect(); 
0
public JedisPool(final Config poolConfig, final String host, int port, 
     int timeout, final String password) { 
    this(poolConfig, host, port, timeout, password, Protocol.DEFAULT_DATABASE); 
} 

這種方法maybey幫助你。