您好,登錄后才能下訂單哦!
本文小編為大家詳細介紹“Springboot2.6集成redis maven報錯怎么解決”,內容詳細,步驟清晰,細節處理妥當,希望這篇“Springboot2.6集成redis maven報錯怎么解決”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學習新知識吧。
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
當加這個配置后,POM.xml的第一行總是報錯:
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)
看了意思是獲取不到最新包,因為maven之前已經下載過,需要刪除m2庫里的最新玩意,
找到自己倉庫,我的是C:\users\ckw\.m2\repository>,
在這個目錄下,打開cmd,執行:
for /r %i in (*.lastUpdated) do del %i
執行這個批處理,
刪完后,按下面圖,update一把就好了
初學SpringBoot
當進行SpringBoot集成Redis時。測試向redis中添加String類型的數據,key=name , value = zlw
。
但出現了一下錯誤:(Whitelabel Error Page)
看控制臺輸出發現,大致應該是redis沒有連接成功。
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
上網搜索了好多這個問題的錯誤,但好像都沒有解決,不是自己的錯誤,但后來回想到,學習linux的時候,想要連接成功必須要關閉linux的防火墻才行。。。
試一試
可以看到防火墻已經關閉了,
哇~有新發現了,雖然頁面還是沒有變化,但控制臺的信息發生了變化。
提示:
WRONGPASS invalid username-password pair or user is disabled.
這應該是我的redis密碼有問題。。
原來是我的密碼加上了引號
記住:密碼要去掉引號!!!
去掉雙引號之后再次訪問,成功!!
讀到這里,這篇“Springboot2.6集成redis maven報錯怎么解決”文章已經介紹完畢,想要掌握這篇文章的知識點還需要大家自己動手實踐使用過才能領會,如果想了解更多相關內容的文章,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。