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

FST 2.57 sometime give me ClassCastException on read #334

Open
trixprod opened this issue Mar 22, 2023 · 0 comments
Open

FST 2.57 sometime give me ClassCastException on read #334

trixprod opened this issue Mar 22, 2023 · 0 comments

Comments

@trixprod
Copy link

It's pretty hard to debug as it's not always reproductible.

I've got a server which use heavily FST in a testing environment.
In 99.99% of cases everything is fine, but sometimes FST deserializes my object badly.

In my observation :

  • Object are well written, if a relaunch the Thread or i copy the object to inspect it, FST will read the object without issues ...
  • The ClassCastException occurs in some class. In my case i've got :
    java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')

My object is a Map<ZonedDateTime, Set> and FST deserialize it as a ... simple String ?!

Also, in the past, i caught another class occuring :
Exptected result was : MyDto(name='ABC',technicalName=null, rank= null).
FST was trying to cast my object to the String 'ABC'.
My workaround was to fit MyDto with not null fields ... very strange.

In my Map case, i've no workaround to play with so i'm trying to reach some help.
Here is my read code, quite simple :

FSTConfiguration config = FSTConfiguration.getDefaultConfiguration(); byte data[] = config.asByteArray(obj);

I'm working in a multithreaded environment ( Java thread ).
It's not a memory issue ( mem tested and fine ).

Have you experimented similar situations ?
I'm not able to update FST version, i'm stuck with OpenJdk 11.

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

1 participant