2019-05-1513:39:59.973 [redisson-netty-2-3] ERROR o.r.c.h.CommandDecoder [decodeCommand:203] - Unable to decode data. channel: [id: 0x477c5ced, L:/192.168.4.94:57423 - R:10.10.10.43/10.10.10.43:6379], reply: ReplayingDecoderByteBuf(ridx=102, widx=102), command: (GET), params: [Geek:xxxxx:xxxx] java.io.IOException: java.lang.NullPointerException at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:247) at org.redisson.codec.FstCodec$1.decode(FstCodec.java:228) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:368) at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:200) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:140) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:115) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
测试代码
1 2
RBucket ste = redissonClient.getBucket("Geek:add:ddd"); Object re = ste.get();
publicConfig(Config oldConf){ setExecutor(oldConf.getExecutor()); if (oldConf.getCodec() == null) { // use it by default oldConf.setCodec(new FstCodec()); } ...... }
即检测到原有codec为空时,则设置为FstCodec
看一下 Redisson.java 配置关键部分代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
protectedRedisson(Config config){ this.config = config; Config configCopy = new Config(config);
connectionManager = ConfigSupport.createConnectionManager(configCopy); evictionScheduler = new EvictionScheduler(connectionManager.getCommandExecutor()); writeBehindService = new WriteBehindService(connectionManager.getCommandExecutor()); } publicstatic RedissonClient create(Config config){ Redisson redisson = new Redisson(config); if (config.isReferenceEnabled()) { redisson.enableRedissonReferenceSupport(); } return redisson; }