ERR value is not an integer or out of range

org.springframework.dao.InvalidDataAccessApiUsageException: ERR value is not an integer or out of range; nested exception is redis.clients.jedis.exceptions.JedisDataException: ERR value is not an integer or out of range
	at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:64) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:41) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.connection.jedis.JedisConnection.convertJedisAccessException(JedisConnection.java:212) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.connection.jedis.JedisConnection.incrBy(JedisConnection.java:1439) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.connection.DefaultStringRedisConnection.incrBy(DefaultStringRedisConnection.java:444) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.core.DefaultValueOperations$3.doInRedis(DefaultValueOperations.java:66) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.core.DefaultValueOperations$3.doInRedis(DefaultValueOperations.java:63) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:202) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:164) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:88) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at org.springframework.data.redis.core.DefaultValueOperations.increment(DefaultValueOperations.java:63) ~[spring-data-redis-1.7.2.RELEASE.jar:na]
	at com.xdja.eoa.util.RedisUtil$Strings.incrBy(RedisUtil.java:804) ~[eoa-base-1.0.0.jar:na]
	at com.xdja.eoa.mobile.control.login.LoginLogoutController.login(LoginLogoutController.java:133) ~[eoa-mobile-1.0.0.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_71]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_71]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_71]
	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_71]
  • 由於使用了JDK序列化方式,加上了版本號,當你使用incrby時不能轉換成數字進行相加,修改爲StringRedisSerializer,便可解決。
相關文章
相關標籤/搜索