Pivotal Knowledge Base

Follow

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

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.

Symptoms

  • 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.

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.

Comments

Powered by Zendesk