alibaba / fastjson2

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

graalvm 打包问题FieldOffset自动替换失败。由于在com.alibaba.fastjson2.util.JDKUtils的静态初始化器中检测到对sun.misc.Unsafe.objectFieldOffset(Field)的调用,因此尝试进行自动替换注册。详细的失败原因:无法确定调用sun.misc.Unsafe.objectFieldOffset(field)计算字段偏移量时产生的值存储在哪个字段 #3137

Open ZhangChengJi opened 3 weeks ago

ZhangChengJi commented 3 weeks ago

RecomputeFieldValue.FieldOffset automatic substitution failed. The automatic substitution registration was attempted because a call to sun.misc.Unsafe.objectFieldOffset(Field) was detected in the static initializer of com.alibaba.fastjson2.util.JDKUtils. Detailed failure reason(s): The argument of sun.misc.Unsafe.objectFieldOffset(java.lang.reflect.Field) is not a constant value or a field load that can be constant-folded., Could not determine the field where the value produced by the call to sun.misc.Unsafe.objectFieldOffset(Field) for the field offset computation is stored.

ZhangChengJi commented 3 weeks ago

image