Querying objects serialized with ReflectionBasedAutoSerializer from gfsh on GemFire 6.6.x fails with the error: not deserialize pdx because a PdxSerializer does not exist
search cancel

Querying objects serialized with ReflectionBasedAutoSerializer from gfsh on GemFire 6.6.x fails with the error: not deserialize pdx because a PdxSerializer does not exist

book

Article ID: 294080

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

Symptoms:
Querying objects serialized with ReflectionBasedAutoSerializer from gfsh on GemFire 6.6.x fails with the error: not deserialize pdx because a PdxSerializer does not exist.
  • Cannot query objects serialized with ReflectionBasedAutoSerializer from gfsh in GemFire 6.6.x
  • Querying objects serialized with ReflectionBasedAutoSerializer fails with a PdxSerializationException:
    gfsh:/>select -l 5           
    gfsh:/>select * from /MyPDXRegion
    
    Error: PdxSerializationException -- Could not deserialize pdx because a PdxSerializer does not exist.

Environment


Cause

This issue occurs because a PdxSerializer does not exist.

Resolution

To resolve this issue, you must prepare a Pdx Serializer before starting gfsh:
  1. Create your cache.xml for gfsh, such as gfsh-cache.xml, similar to:
    <?xml version="1.0"?>
    <!DOCTYPE cache PUBLIC "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.6//EN" "http://www.gemstone.com/dtd/cache6_6.dtd">
    
    <cache>
      <pdx read-serialized="false">
        <pdx-serializer>
          <class-name>com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer</class-name>
          <parameter name="classes">
            <string>your.package.name.for.your.classes.*</string>
          </parameter>
        </pdx-serializer>
      </pdx>
    </cache>
  2. Set the environment parameter pointing to the cache.xml file created in Step 1:
    $ export JAVA_ARGS="-Dgemfire.cache-xml-file=/path/to/gfsh-cache.xml"
    $ gfsh -l .... -c ...
  3. Start gfsh.