pilgr / Paper

Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
Apache License 2.0
2.34k stars 234 forks source link

Java 17 causes "InaccessibleObjectException" for ArraysAsListSerializer #208

Open tinder-johnbuhanan opened 1 year ago

tinder-johnbuhanan commented 1 year ago

Due to PaperDB's use of kryo-serializers, "ArraysAsListSerializer" is not compatible with Java 17. https://github.com/magro/kryo-serializers/issues/131

Is there anyway we can make "ArraysAsListSerializer" compatible with Java 17?

tinder-johnbuhanan commented 1 year ago

Seems to me that this part could be solved by this StackOverflow post.

image

https://stackoverflow.com/a/75473860

tinder-johnbuhanan commented 1 year ago

They say that Kryo5 should work: https://github.com/magro/kryo-serializers/issues/131#issuecomment-1528728575

Any plans for PaperDB to update to Kryo5?

pilgr commented 1 year ago

Any plans for PaperDB to update to Kryo5?

I don't have such plans at the moment. I believe you can add your custom serializer as a workaround.

ruimendesM commented 1 year ago

I don't have such plans at the moment. I believe you can add your custom serializer as a workaround.

Was looking into this topic, as I am currently facing the same problem and adding a custom serializer it is not enough I believe. The error occurs on the creation of the Kryo Instance here, which calls the constructor of the ArraysAsListSerializer containing the "problematic code".

So even if I add a custom serializer, the code will still fail at the same line.

aeaa1998 commented 9 months ago

Due to PaperDB's use of kryo-serializers, "ArraysAsListSerializer" is not compatible with Java 17. magro/kryo-serializers#131

Is there anyway we can make "ArraysAsListSerializer" compatible with Java 17?

Hello! Did you found a solution for this? I have the same issue but it can only be reproduced when running unit tests.