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

java.lang primitives serialization - JDK-8256358 - JDK 17 support #154

Closed
mvangoor opened this issue Sep 28, 2021 · 12 comments
Closed

java.lang primitives serialization - JDK-8256358 - JDK 17 support #154

mvangoor opened this issue Sep 28, 2021 · 12 comments

Comments

@mvangoor
Copy link

Hi,

In JDK 16 the default for illegal-access switched to deny (was permit) and in 17 this option was removed completely.
For context see:

Basically every java.lang class cannot be serialized anymore and will throw an java.lang.IllegalAccessException starting JDK16 (can be changed) and perm since JDK17.

The Exception is silently ignored at https://github.com/jdereg/json-io/blob/master/src/main/java/com/cedarsoftware/util/io/JsonWriter.java#L2305

I could create a custom writer to call "toString()" for any java.lang primitive, but thought it worth opening an issue to get insight in others thoughts so please respond.

@ghost
Copy link

ghost commented Sep 29, 2021

ping @jdereg

@wwang-talend
Copy link
Contributor

#156 maybe this help, that fix some issues for primitive, better if you can help review..

@jdereg
Copy link
Owner

jdereg commented Nov 11, 2021

#156 added and released. @mvangoor - can you verify if json-io 4.14.0, which contains #156, fixes the issue you were having?

@poberbichler
Copy link

@jdereg was this version actually released?
According to https://search.maven.org/artifact/com.cedarsoftware/json-io the latest version is still 4.13.0

@reuschling
Copy link
Contributor

Also, the version number in the repo pom.xml is still 4.13.0 I would be happy to help testing the new java17 support. What is the preferred way? Just check it out?

@jdereg
Copy link
Owner

jdereg commented Mar 16, 2022 via email

@reuschling
Copy link
Contributor

Ah, I assumed there is java 17 support yet and only testing is left, according to #156. You mentioned you released this as 4.14.0? I don't know what is left. First step would be a number of test cases or simply problematic Objects for test cases. I have seen one test yet in the code here.

Has anybody examples for problematic objects?

I am currently aware of (from the issues):

  1. java.lang.primitives (this issue) => should be addressed by support java 17 #156 according to @wwang-talend
  2. enum serialization Enum serialization error with Java 17 #155 => should be addressed by support java 17 #156 also
  3. Maybe my issue according deserialisation of records Deserialization of records doesn't work in Java15 #151

@mvangoor
Copy link
Author

Hi @jdereg,

First of all sorry for not responding at all.
I lost track of this issue and somehow the messages to remind me got into some obscure trash folder...

That said I recently stumbled upon this sissue 'again' and found this thread with all nice updates!

I manually built the latest master branch as 4.14.0 and tried it out.
So far all tests are passing and primitives are being handled correctly.

I reached out to a few people to also test it and hope to have a final reply asap.

Again sorry for the delay!

Regards,
Mike

@jdereg
Copy link
Owner

jdereg commented Oct 14, 2022

json-io 4.14.0 has been released. The fixes that have been submitted to support JDK through 17 are included. Let me know if you have any issues.

@mvangoor
Copy link
Author

Hi @jdereg ,

Appreciate the reply, especially since I've been awol for soo long... again truly sorry about that.

I checked the tags and maven repository, I do not see a 4.14.0 there.
Am I missing something? :)

Regards,
Mike

@jdereg
Copy link
Owner

jdereg commented Oct 15, 2022 via email

@mvangoor
Copy link
Author

Thanks, all looking good now.

Closing :)

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