@Override
public byte[] serialize(Object obj) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
Hessian2Output hessian2Output = new Hessian2Output(out);
try {
hessian2Output.writeObject(obj);
hessian2Output.flush();
} catch (Exception e) {
e.printStackTrace();
}
return out.toByteArray();
}
报错:
java.lang.reflect.InaccessibleObjectException: Unable to make field final int java.math.BigInteger.signum accessible: module java.base does not "opens java.math" to unnamed module @2f410acfjava.lang.reflect.InaccessibleObjectException: Unable to make field final int java.math.BigInteger.signum accessible: module java.base does not "opens java.math" to unnamed module @2f410acf
JDK: 17 hessian-lite version: 3.2.12
序列化代码如下:
报错: