【原】Spring整合Redis(第三篇)—盤點SDR搭建中易出現的錯誤


易錯點01:Spring版本過低導致的錯誤
【環境參數】
Redis版本:redis-2.4.5-win32-win64
Spring原來的版本:4.1.7.RELEASE
Spring修改后的版本:4.2.6.RELEASE

【障礙描述】
Question:NoSuchMethodError
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
org.springframework.core.serializer.support.DeserializingConverter.<init>(Ljava/lang/ClassLoader;)V

【原因分析】
原因:Spring的版本過低
在SDR的官網中,有如下一段描述:
Spring Data Redis 1.x binaries requires JDK level 6.0 and above, and Spring Framework 4.2.6.RELEASE and above.

參考連接:
http://coding84.com/article/24274915611907308.html
http://docs.spring.io/spring-data/redis/docs/1.7.2.RELEASE/reference/html/


易錯點02:設置redis的數據庫Index
Redis默認有16個數據庫,在配置文件中,設置Redis需要使用的哪個Redis數據庫,應該使用屬性“database”,而不是“dbIndex(自定義)”這個屬性。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM