當我調用get()方法,異常發生彈簧數據redis的redisTemplate異常
這裏是代碼
@Service("RedisService")
public class RedisServiceImpl implements RedisService {
@Autowired
RedisTemplate<String, Long> redisTemplate;
@Override
public Long get(String key) {
return redisTemplate.opsForValue().get(key);
}
@Override
public Long incrBy(String key, long increment) {
return redisTemplate.opsForValue().increment(key, increment);
}
當我使用incrBy方法,有沒有異常,但只僅錯誤獲得方法
這裏是堆棧跟蹤---
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2280)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2749)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:779)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:279)
at org.springframework.core.serializer.DefaultDeserializer.deserialize(DefaultDeserializer.java:38)
at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:58)
at org.springframework.core.serializer.support.DeserializingConverter.convert(DeserializingConverter.java:1)
at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize(JdkSerializationRedisSerializer.java:40)
at org.springframework.data.redis.core.AbstractOperations.deserializeValue(AbstractOperations.java:198)
at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:50)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:162)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:133)
at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84)
at org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:42)
at net.daum.air21.bot.common.service.RedisServiceImpl.get(RedisServiceImpl.java:29)
at net.daum.air21.bot.user.service.SeraCoffeeServiceImpl.getCurrentCount(SeraCoffeeServiceImpl.java:41)