Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible serialized files between 2.x and 3.x versions (tested while upgrading to java 17) #319

Open
istinnstudio opened this issue Dec 22, 2021 · 8 comments

Comments

@istinnstudio
Copy link

I have tried to upgrade fst from version 2.57/java11 to 3.0.3/java17 and see what happens

As far as I can see, in my case, first of all, there are some reflection related error messages like this one: Exception in thread "AWT-EventQueue-0" java.lang.reflect.InaccessibleObjectException: Unable to make private void java.awt.geom.Path2D$Double.writeObject(java.io.ObjectOutputStream) throws java.io.IOException accessible: module java.desktop does not "opens java.awt.geom" to unnamed module @df84c76
....
Exception in thread "AWT-EventQueue-0" java.lang.reflect.InaccessibleObjectException: Unable to make field int java.awt.Color.value accessible: module java.desktop does not "opens java.awt" to unnamed module @594255bc

those issues have been temporarily resolved by adding
" --add-opens=java.desktop/java.awt.geom=ALL-UNNAMED" or
" --add-opens=java.desktop/java.awt=ALL-UNNAMED"
etc. ... for every error case as suggested here: #312

But it seems that there is some kind of incompatibility between 2.x and 3.x versions. Serialization files are incompatible between those versions and i/o between them fails. Is this normal?
Additionally, after some short tests with 2.57/java17 (after resolving all those reflect.InaccessibleObjectException errors), everything seems to work ok! with all my 2.x serialized files, without any i/o issues so far...
so I guess it is ok to still use 2.x version and move to 3.x only when there is a serious reason to do so. What do you think?

@istinnstudio
Copy link
Author

#306 (comment)

.. a way to develop a converter between different versions, reposting the link.

@winrid
Copy link

winrid commented May 8, 2022

Also running into this. It seems like we can't use Java 17 on our backend and 1.8 on Android because we need 3.x to use Java 17?

fyi @RuedigerMoeller

@winrid
Copy link

winrid commented May 8, 2022

I see, it appears that maybe 2.57 will work fine with Java 17.

@RuedigerMoeller
Copy link
Owner

RuedigerMoeller commented May 9, 2022 via email

@Tiller
Copy link

Tiller commented May 16, 2022

In this
branch there is also a list of add-opens parameters (readme) so you can run
it with jdk 17

@RuedigerMoeller is there?

@winrid
Copy link

winrid commented May 16, 2022

Yeah but Android only supports 1.8 so it's not v3 compatible right?

@istinnstudio
Copy link
Author

istinnstudio commented May 16, 2022

"there is a branch targeting java 17". I am not sure if this is something really worth to do, but (I think) I have easily managed to back-port the "memory api of java 17" from jdk-17 branch
https://github.com/RuedigerMoeller/fast-serialization/tree/jdk17/src/main/java/org/nustaq/offheap
to 2.57 (sources from maven not git) just for fun to see if possible. It seems to work ok with my i/o serialization in place replacement of native. I could post a link of a project that compiles ok with edited maven. It still needs " -add-opens ...", and does not break previously created serialization. I do not know if there is any valuable benefit from this, and maybe buggy. I am not familiar with the internals of fast-serialization. So there might be a chance that new code could live ok in the latest 2.x version. More experienced users could evaluate this.

edit: https://github.com/istinnstudio/fast-serialization-2.57-java17

@thalesvalias
Copy link

@RuedigerMoeller hey, sorry, I know this is a bit old, but in your previous comment you mentioned a list of add-opens parameters on readme in the jdk17 branch, however, I couldn't find it anywhere. Actually, that readme is not updated taking into account java 17. Maybe I'm missing something. Anyway, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants