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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

spring-redis文件有問(wèn)題。

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

報(bào)錯(cuò):NOAUTH Authentication required,

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

requirepass?mypassword

如果我注釋掉,也能解決問(wèn)題,但是又不想注釋,那就修改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>

啟動(dòng)報(bào)錯(cuò)上面的錯(cuò)誤。

修改版:

<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>

啟動(dòng)時(shí)報(bào)錯(cuò)。

一直嘗試,又看了JedisPool源碼,猜測(cè)是不是和入?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)系,通過(guò)字段名稱映射的,你可以將配置信息直接配置到properties文件中,然后直接讓Spring加載進(jìn)來(lái)即可

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

頑皮地牛

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

舉報(bào)

0/150
提交
取消

spring-redis文件有問(wèn)題。

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

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

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