RuedigerMoeller / fast-serialization

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

java.lang.NullPointerException: "org.nustaq.serialization.FSTClazzInfo$FSTFieldInfo.getPossibleClasses()" #315

Open rhishirajnema opened 3 years ago

rhishirajnema commented 3 years ago

I am receiving this error from class FSTObjectInput - line number 357.

java.lang.NullPointerException: Cannot load from object array because the return value of "org.nustaq.serialization.FSTClazzInfo$FSTFieldInfo.getPossibleClasses()" is null

What should I have in possibleClasses so that it does not result in NullPointerException? Here is the FSTFieldInfo for which this is failing -

Screen Shot 2021-06-16 at 10 30 01 PM

I have another with same information but that works and code resolved is not equals to 1 -

Screen Shot 2021-06-16 at 10 31 51 PM
Sneakometer commented 2 years ago

Same here, using as a drop in replacement for redisson.

rhishirajnema commented 2 years ago

We have stopped using this library and all our issues are resolved. I don't think this library provides any advantage even in terms of performance.

Sneakometer commented 2 years ago

We have stopped using this library and all our issues are resolved. I don't think this library provides any advantage even in terms of performance.

What are you using now? Inbuild java object serialization?

rhishirajnema commented 2 years ago

We have stopped using this library and all our issues are resolved. I don't think this library provides any advantage even in terms of performance.

What are you using now? Inbuild java object serialization?

Yes.

bluelu commented 2 years ago

I had the same exception and it was related to using the same encode instance in multiple threads, since it is not threadsafe.

Make sure to use a construct like the following as described on https://github.com/RuedigerMoeller/fast-serialization/wiki/Serialization

static ThreadLocal conf = new ThreadLocal() { public FSTConfiguration initialValue() { return FSTConfiguration.createDefaultConfiguration(); } };