alibaba / fastjson2

🚄 FASTJSON2 is a Java JSON library with excellent performance.
Apache License 2.0
3.82k stars 499 forks source link

[BUG] #2930

Open liujunjie2009 opened 2 months ago

liujunjie2009 commented 2 months ago

问题描述

graalvm 21,编译为native 二进制包时,读取boolean类型失败

环境信息

请填写以下信息:

相关日志输出

Caused by: com.alibaba.fastjson2.JSONException: syntax error : 102 at com.alibaba.fastjson2.JSONReaderUTF8.readBoolValue(JSONReaderUTF8.java:7518) at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readObject(ObjectReaderImplObject.java:287) at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:2229) at com.alibaba.fastjson2.JSONReader.readAny(JSONReader.java:2380) at c.x.g.common.support.RedisJSONCodec$JSONDecoder.decode(RedisJSONCodec.java:124) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:440) at org.redisson.client.handler.CommandDecoder.decodeList(CommandDecoder.java:497) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:449) at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144) at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530) at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

benname commented 2 months ago

同遇到了,经测试boolean为字符串时(带双引号key:"false")则正常解析;不带双引号(key:false)时,parseObject出现此错误

hawind commented 2 weeks ago

同样遇到了,这么解决这个问题呢