VMware GemFire

 View Only

 Can not config pdx in cache.xml to start a server?

Charles Edison's profile image
Charles Edison posted Nov 19, 2018 03:46 PM

gemfire version:9.1.1

cmd: start server --name=server1 --chache-xml-file=../config/cache.xml

I'm trying to start a cache server with pdx config in cache.xml as it shown in the document, but a exception is thrown

however, I can do the pdx config using cmd: configure pdx --disk-store=DEFAULT --read-serialized=true successfully

I wonder which part is wrong in the cache.xml, or is there a way to start a server with cache.xml configuring the pdx attributes?

the cache.xml and exception capture is attached, please help

Juan Cassella's profile image
Juan Cassella

Hello Charles,

 

Thanks for contacting the Pivotal Support Community!.

I think the issue should go away if you move the pdx declaration above in the configuration, currently the XML parser is way to strict and elements should appear in order.

In summary, the following cache.xml should work:

<?xml version="1.0" encoding="UTF-8"?> <cache xmlns="http://geode.apache.org/schema/cache" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd" version="1.0">   <cache-server port="40404" max-connections="20"/>   <pdx read-serialized="true"> <pdx-serializer> <class-name>org.apache.geode.pdx.ReflectionBasedAutoSerializer</class-name> </pdx-serializer> </pdx>   <region name="ROOT"> <region-attributes refid="REPLICATE"/> </region> </cache>

Hope this helps.

Cheers.