Redistemplate uses increment to report an error: io.lettuce.core.RedisCommandExecutionException: ERR value is not an intege
Problem analysis
We can learn from spring’s documents that spring has two rare serialization strategies for redis. One is the JDKSerializationRedisSerialzer serialization of RedisTemplate application. The serialized value contains object information, version number, class information, etc. after this serialization, a string cannot be self incremented.
The other is the StringRedisSerializer adopted by the StringRedisTemplate. This strategy converts the string value into a byte array, so the values saved in redis can be operated.
Solution:
Replace RedisTemplate with String RedisTemplate
Read More:
- Defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ in your configuration.
- [Solved] Consider defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate‘ in your configu
- [Solved] java.lang.IllegalAccessError: class org.springframework.data.redis.core.$ Proxy237 cannot access its superinterface org.springframework.data.redis.core.RedisConnectionUtils$RedisConnectionProxy
- Mongodb java version 3.X, prompt “XXX (an encryption algorithm) is not available” when there is a user name and password
- Mybatis sets the primary key Auto-Increment error: No setter found for the keyProperty
- I/O error while reading input message; nested exception is java.io.IOException: Stream closed
- How to Solve Error:java.io.InvalidClassException
- [Solved] Mac Homebrew Error: homebrew-core is a shallow clone.
- [Solved] IDEA2021.3 Error: Failed to write core dump. Minidumps are not enabled by default on client versions of
- Springboot startup error: err config is disabled command (Redis Disables Config command)
- [Solved] JAVA connect HBase program is stuck and does not report an error
- [Solved] Logstash Error: Logstash – java.lang.IllegalStateException: Logstash stopped processing because of an err
- Springboot integrates Redis annotation and access error: java.io.NotSerializableException: com.demo.entity.MemberEntity
- [Integrate the mobile MAS SMS service] SDK start error: NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtil
- Flink Error: is not serializable. The object probably contains or references non serializable fields.
- NoClassDefFoundError: io/ebean/bean/ EntityBean [How to Solve]
- Java Error: No enclosing instance of type Main is accessible. Must qualify the allocation with an encl
- C++: Implementation of multi-channel IO transfer with select
- [Solved] Read the resources resource and convert it to file error: java.io.filenotfoundexception
- [Solved] Classnotfoundexception: org.springframework.core.nativedetector error