-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[GR-54965] objectInputStream.readObject() issue with springboot 3.3.0 graalvm22 as native image #8929
Comments
Thanks for looking into this @fernando-valdez |
Hi @KafkaProServerless, can you please share more details on how you are building the native image? Also, what is the exact version of GraalVM you are using? If this is not the latest version, can you please try the latest version and share of the problem still happens? |
Sure, so, I am using the latest springBoot 3.3.0-RC1. I am building using maven, with the command mvn -Pnative spring-boot:build-image. The graal VM version used is 22.0.1, which I think is very very very recent as of this writing. Please let me know if I need to provide anything else @fernando-valdez |
Thanks. |
Sure, and again thank you for looking into this. So, here is the setup: I am using ubuntu 22.04.4 LTS Could you please:
Could you please let me know if you got to this point without issue? |
Once done, could you just do perform from here:
Could you please try this and let me know if you reproduce as well? |
Please let me know if the example is not clear enough @fernando-valdez |
Any update please @fernando-valdez |
Thanks for your patience, but I don't think this is a direct issue from the native image. The error you see is caused because you are using Java serialization and have two different versions of the same class. Here is an extract from the java docs:
So you can try to refactor your code to explicitly set the value of the I hope this helps! |
Thank you for the answer. May I ask if you managed to reproduce the issue on your side? @fernando-valdez And are you suggesting I should refactor java.util.Map ? |
@fernando-valdez we should first reproduce this issue, then we should run this with |
Hello @fernando-valdez , Please let me know what you need from my side, I will be glad to assist. |
Hello @KafkaProServerless, let me share my updates:
|
Created internal ticket: GR-54965 |
@fernando-valdez can you try adding |
Hello team,
I would like to reach out regarding a small issue.
I have a very simple piece of code in my springboot 3.3 application.
The piece of code is:
This code would run fine on non native image, battle tested in production.
Now, we successfully built a native image.
However, at run time, we would get an issue saying we need to add this
java.util.Collections$UnmodifiableMap
in this fileserialization-config.json
, for line:return (Map<?, ?>) objectInputStream.readObject();
We followed the instructions, not knowing if the instructions were correct to begin with.
After following the instructions, we get this error message:
Therefore, I would like to reach out, asking for help on this issue which is happening only with native images.
How to make
return (Map<?, ?>) objectInputStream.readObject();
work with native image?Thank you for your time and good day!
The text was updated successfully, but these errors were encountered: