您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“Springboot2.6集成redis maven報(bào)錯(cuò)怎么解決”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“Springboot2.6集成redis maven報(bào)錯(cuò)怎么解決”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來(lái)學(xué)習(xí)新知識(shí)吧。
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
當(dāng)加這個(gè)配置后,POM.xml的第一行總是報(bào)錯(cuò):
Description Resource Path Location Type
io.lettuce:lettuce-core:jar:6.1.8.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact io.lettuce:lettuce-core:jar:6.1.8.RELEASE from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.org.eclipse.aether.transfer.ArtifactTransferException: io.lettuce:lettuce-core:jar:6.1.8.RELEASE failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact io.lettuce:lettuce-core:jar:6.1.8.RELEASE from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:225)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:189)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:574)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:484)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:402)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:340)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:191)
at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:227)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:200)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:124)
看了意思是獲取不到最新包,因?yàn)閙aven之前已經(jīng)下載過(guò),需要?jiǎng)h除m2庫(kù)里的最新玩意,
找到自己倉(cāng)庫(kù),我的是C:\users\ckw\.m2\repository>,
在這個(gè)目錄下,打開cmd,執(zhí)行:
for /r %i in (*.lastUpdated) do del %i
執(zhí)行這個(gè)批處理,
刪完后,按下面圖,update一把就好了
初學(xué)SpringBoot
當(dāng)進(jìn)行SpringBoot集成Redis時(shí)。測(cè)試向redis中添加String類型的數(shù)據(jù),key=name , value = zlw
。
但出現(xiàn)了一下錯(cuò)誤:(Whitelabel Error Page)
看控制臺(tái)輸出發(fā)現(xiàn),大致應(yīng)該是redis沒(méi)有連接成功。
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.86.129/<unresolved>:6379] with root cause
上網(wǎng)搜索了好多這個(gè)問(wèn)題的錯(cuò)誤,但好像都沒(méi)有解決,不是自己的錯(cuò)誤,但后來(lái)回想到,學(xué)習(xí)linux的時(shí)候,想要連接成功必須要關(guān)閉linux的防火墻才行。。。
試一試
可以看到防火墻已經(jīng)關(guān)閉了,
哇~有新發(fā)現(xiàn)了,雖然頁(yè)面還是沒(méi)有變化,但控制臺(tái)的信息發(fā)生了變化。
提示:
WRONGPASS invalid username-password pair or user is disabled.
這應(yīng)該是我的redis密碼有問(wèn)題。。
原來(lái)是我的密碼加上了引號(hào)
記住:密碼要去掉引號(hào)?。?!
去掉雙引號(hào)之后再次訪問(wèn),成功!!
讀到這里,這篇“Springboot2.6集成redis maven報(bào)錯(cuò)怎么解決”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過(guò)才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。