第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

spring-redis文件有問題。

https://img1.sycdn.imooc.com//5d42aa2f0001269f08180244.jpg

報錯:NOAUTH Authentication required,

解決:我在redis配置文件中,配有

requirepass?mypassword

如果我注釋掉,也能解決問題,但是又不想注釋,那就修改spring-redis.xml文件吧,

最初一版:

<bean?class="redis.clients.jedis.JedisPool"?id="jedisPool">
????<constructor-arg?name="poolConfig"?ref="jedisPoolConfig"/>
????<constructor-arg?name="host"?value="127.0.0.1"/>
????<constructor-arg?name="port"?value="6389"/>
??<!--??<constructor-arg?name="timeout"?value="60000"/>
????<constructor-arg?name="password"?value="mypassword"/>-->
</bean>

啟動報錯上面的錯誤。

修改版:

<bean?class="redis.clients.jedis.JedisPool"?id="jedisPool">
????<constructor-arg?name="poolConfig"?ref="jedisPoolConfig"/>
????<constructor-arg?name="host"?value="127.0.0.1"/>
????<constructor-arg?name="port"?value="6389"/>
??<!--??<constructor-arg?name="timeout"?value="60000"/>-->
????<constructor-arg?name="password"?value="mypassword"/>
</bean>

啟動時報錯。

一直嘗試,又看了JedisPool源碼,猜測是不是和入?yún)㈨樞蛴嘘P(guān)

最終一版,就成功了;

<bean?class="redis.clients.jedis.JedisPool"?id="jedisPool">
????<constructor-arg?name="poolConfig"?ref="jedisPoolConfig"/>
????<constructor-arg?name="host"?value="127.0.0.1"/>
????<constructor-arg?name="port"?value="6389"/>
?????<constructor-arg?name="timeout"?value="60000"/>
????<constructor-arg?name="password"?value="mypassword"/>
</bean>


正在回答

2 回答

給力吖


0 回復(fù) 有任何疑惑可以回復(fù)我~

與順序沒關(guān)系,通過字段名稱映射的,你可以將配置信息直接配置到properties文件中,然后直接讓Spring加載進來即可

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

頑皮地牛

不好意思,看錯了,你是構(gòu)造方法,不是設(shè)置屬性。是的,與順序有關(guān)系,要按照順序傳入
2019-08-01 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

spring-redis文件有問題。

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號