InvalidClassException local class incompatible for custom cache store factory

classic Classic list List threaded Threaded
3 messages Options
relax ken relax ken
Reply | Threaded
Open this post in threaded view
|

InvalidClassException local class incompatible for custom cache store factory

Hi,

I am testing my custom CacheStoreFactory. It worked fine previously on my local dev machine. After I changed this class and run it, I got `java.io.InvalidClassException: xxx.CacheStoreFactory; local class incompatible: stream classdesc serialVersionUID = 7199421607011991053, local class serialVersionUID = -7841220943604923990`

Is it the previous serialized class cached somewhere and incompatible with the new one? I only have this single node. There is no other nodes.

Another question is I try to understand why CacheStoreFactory and CacheStore are serialized to newly joined node. Does it mean if I changed their implementation and release the changes to a new node, the new node will still perform as the old one?

Very appreciate any help.

Thanks,

Ken
Denis Mekhanikov Denis Mekhanikov
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

Ken,

Cache store factory is a part of a cache configuration. So, if a cache configuration is stored somewhere, and it's deserialized using a new class, then this exception is thrown.
It's possible if you have native persistence enabled, for example. The cache configuration is read from disk when a node starts.

Cache configurations are sent to newly joined nodes along with discovery data. If you want to change the cache store implementation, then you should destroy the cache and start it with a new config.
Different implementations of cache store on different nodes is not a correct situation, so you should avoid it.

Denis

вт, 19 мар. 2019 г. в 20:30, relax ken <[hidden email]>:
Hi,

I am testing my custom CacheStoreFactory. It worked fine previously on my local dev machine. After I changed this class and run it, I got `java.io.InvalidClassException: xxx.CacheStoreFactory; local class incompatible: stream classdesc serialVersionUID = 7199421607011991053, local class serialVersionUID = -7841220943604923990`

Is it the previous serialized class cached somewhere and incompatible with the new one? I only have this single node. There is no other nodes.

Another question is I try to understand why CacheStoreFactory and CacheStore are serialized to newly joined node. Does it mean if I changed their implementation and release the changes to a new node, the new node will still perform as the old one?

Very appreciate any help.

Thanks,

Ken
relax ken relax ken
Reply | Threaded
Open this post in threaded view
|

Re: InvalidClassException local class incompatible for custom cache store factory

Thanks! 

On Wed, Mar 20, 2019 at 8:15 AM Denis Mekhanikov <[hidden email]> wrote:
Ken,

Cache store factory is a part of a cache configuration. So, if a cache configuration is stored somewhere, and it's deserialized using a new class, then this exception is thrown.
It's possible if you have native persistence enabled, for example. The cache configuration is read from disk when a node starts.

Cache configurations are sent to newly joined nodes along with discovery data. If you want to change the cache store implementation, then you should destroy the cache and start it with a new config.
Different implementations of cache store on different nodes is not a correct situation, so you should avoid it.

Denis

вт, 19 мар. 2019 г. в 20:30, relax ken <[hidden email]>:
Hi,

I am testing my custom CacheStoreFactory. It worked fine previously on my local dev machine. After I changed this class and run it, I got `java.io.InvalidClassException: xxx.CacheStoreFactory; local class incompatible: stream classdesc serialVersionUID = 7199421607011991053, local class serialVersionUID = -7841220943604923990`

Is it the previous serialized class cached somewhere and incompatible with the new one? I only have this single node. There is no other nodes.

Another question is I try to understand why CacheStoreFactory and CacheStore are serialized to newly joined node. Does it mean if I changed their implementation and release the changes to a new node, the new node will still perform as the old one?

Very appreciate any help.

Thanks,

Ken