RuedigerMoeller / fast-serialization

FST: fast java serialization drop in-replacement
Apache License 2.0
1.58k stars 248 forks source link

Not support JDK 17 LTS #327

Open TinyZzh opened 2 years ago

TinyZzh commented 2 years ago

image

TinyZzh commented 2 years ago

version: 3.0.3-jdk17

TinyZzh commented 2 years ago

image image

istinnstudio commented 2 years ago

one or more runtime commands like this one should work.. --add-opens=java.base/java.lang=ALL-UNNAMED

Strong Encapsulation in the JDK Java 17 LTS https://github.com/RuedigerMoeller/fast-serialization/issues/312#

MikhailPigolkin commented 1 year ago

2022-09-23_12-54-44 Why doesn't it work on the simplest example? I use jdk 17 with --add-opens=java.base/java.lang=ALL-UNNAMED

MikhailPigolkin commented 1 year ago

2022-09-23_12-54-44 Why doesn't it work on the simplest example? I use jdk 17 with --add-opens=java.base/java.lang=ALL-UNNAMED

everything works fine on 1.8....

durandal1981 commented 1 year ago

I also run in jdk17 with --add-opens=java.base/java.lang=ALL-UNNAMED, but it's also has the problem

istinnstudio commented 1 year ago

This is the run commands I use, but those are related to my project

--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.sql/java.sql=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/sun.nio=ALL-UNNAMED --add-opens=java.desktop/java.awt.geom=ALL-UNNAMED --add-opens=java.desktop/sun.awt.shell=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-exports=java.desktop/sun.awt.image=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED

f0def commented 1 year ago

We're using 3.0.3-jdk17. And it doesn't work without these JVM arguments (related for our requirements):

--add-opens=java.base/java.time=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.math=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.sql/java.sql=ALL-UNNAMED
istinnstudio commented 1 year ago

I am not familiar with the internals of FST, but luckily I use with much of success the 2.57 version with the latest java-17 additions from 3.0.3-jdk17 branch. Some other selected pull requests added also, I do not know what bugs or side effects this might rise.

edit: Here is a link to sources: [2.57-jdk17-backport-experimental] (https://github.com/istinnstudio/fast-serialization-2.57-java17)

A fork to include those mods for those who might find it useful. I use 2.57 because 3.0 version breaks all my serialized files and for the time being I am too lazy to write a mass file converter (as suggested by author). Use it with extreme caution.

ndrsf commented 1 year ago

I tried to make it as easy as possible to use FST with Java 17 using a small example project: https://github.com/ndrsf/fst-java17 But I didn't find a production-ready way to use FST without passing the JVM parameters.

lmeinen commented 1 year ago

Any updates on this issue? Using version 3.0.4-jdk17 doesn't appear to help.

istinnstudio commented 1 year ago

I do not think there is an other way other than "--add-opens" and probably it will stay this way for ever