Anthony, I was able to reproduce the issue with a quite simple class

https://github.com/claudiu-balciza/GeodeDeserializationErrorPOC/tree/develop

the command line application above populates 3 entries of Class1 objects in the 
DeserializationErrorPOC region

the region is created as follows:

gfsh> create region --name=DeserializationErrorPOC 
--type=PARTITION_REDUNDANT_PERSISTENT --recovery-delay=10000 
--disk-store=DataPersistence --enable-statistics=true 
--eviction-action=overflow-to-disk 
--compressor='org.apache.geode.compression.SnappyCompressor' 
--redundant-copies=1

gfsh> describe region --name=DeserializationErrorPOC Name : 
DeserializationErrorPOC Data Policy : persistent partition Hosting Members : 
server1
Name            : DeserializationErrorPOC
Data Policy     : persistent partition
Hosting Members : server1

Non-Default Attributes Shared By Hosting Members

  Type    |        Name        | Value
--------- | ------------------ | ---------------------------------------------
Region    | data-policy        | PERSISTENT_PARTITION
          | size               | 3
          | cloning-enabled    | true
          | disk-store-name    | DataPersistence
          | statistics-enabled | true
          | compressor         | org.apache.geode.compression.SnappyCompressor
Eviction  | eviction-action    | overflow-to-disk
          | eviction-algorithm | lru-heap-percentage
Partition | redundant-copies   | 1
          | recovery-delay     | 10000

The domain class is deployed on the server:
[cid:image001.png@01D6AEBE.BF279570]
gfsh>list deployed
Member  |              JAR               | JAR Location
------- | ------------------------------ | 
-----------------------------------------------------------------
server1 | DeserializationErrorDomain.jar | 
C:\geode\server1\DeserializationErrorDomain.v1.jar

gfsh>export data --region=DeserializationErrorPOC 
--file=geode-storage/DeserializationErrorPOC.gfd --member=server1
Member  | Status | Message
------- | ------ | 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
server1 | ERROR  |  java.io.IOException: 
org.apache.geode.cache.execute.FunctionException: 
org.apache.geode.SerializationException: A ClassNotFoundException was thrown 
while trying to deserialize cached value.


Also the application throws a “SpringBasedCacheClientApplication: 
org.apache.geode.SerializationException: While deserializing query result” 
exception if I try to execute repository.findAll().forEach((item) -> 
System.out.println(item.toString()));

Claudiu Balcîza

From: Anthony Baker <bak...@vmware.com>
Sent: Friday, October 30, 2020 09:56
To: user@geode.apache.org
Subject: Re: A ClassNotFoundException was thrown while trying to deserialize 
cached value

Thanks so much!  The other thing that puzzles me here is that the value is 
being deserialized at all—I thought we could just stream the serialized form 
directly into the export file.

Anthony

Reply via email to