Open akemin-dayo opened 2 years ago
Thanks for the detailed report. What do you think is the best way going forward? In the issue they mention using type adapters as a workaround, but I don't know of any. (There is a repository that added type adapters for Optional
and other Java 8 types, but it has long been abandoned.)
Calling
RegionFolder.save()
can cause Gson to throw an unhandledjava.lang.reflect.InaccessibleObjectException
in certain cases when attempting to serialise aCollection
inSavedRegionHelper
.This is directly related to https://github.com/google/gson/issues/1979#issuecomment-927943566 and the JEP 403: Strongly Encapsulate JDK Internals change made in Java 17.
As seen in that thread, using the JRE argument
--add-opens java.base/java.lang=ALL-UNNAMED
does indeed work around the issue, resulting in BlockMap working correctly again. (※ If you're a normal user coming across this thread since you're experiencing this issue, here's the "solution" you're looking for.)When this exception is thrown,
rendered.json
becomes a 0-length file, resulting in all data being lost (well, more like not ever having been successfully serialised, let alone written to the disk to begin with).It also results in the termination of BlockMap entirely, meaning that any actions that take place after a
RegionFolder.save()
call will also not occur. Most notably, this includes the merging of all rendered images via--create-big-image
.Finally, here's the full stacktrace: