public static PdxSerializer getPdxSerializer() {
    PdxSerializer result = pdxSerializer.get();
    if (result == null && !open && pdxSerializerWasSet) {
      throw new CacheClosedException("Could not PDX serialize because the cache was closed");
    }
    return result;
  }
If the pdxSerializer is ever set to a non-null value then set this to true. It gets reset to
false when init() is called. This was added to fix bug 45116.
geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java