易錯點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(自定義)”這個屬性。