subzero icon indicating copy to clipboard operation
subzero copied to clipboard

Exception in thread "main" com.hazelcast.config.InvalidConfigurationException: cvc-type.3.1.1: Element 'global-serializer'

Open mukul4u2005 opened this issue 5 years ago • 1 comments

Nov 28, 2018 4:12:14 PM com.hazelcast.client.config.XmlClientConfigLocator INFO: Loading 'hazelcast-client.xml' from classpath. Nov 28, 2018 4:12:15 PM com.hazelcast.config.AbstractXmlConfigHelper WARNING: Name of the hazelcast schema location incorrect using default Exception in thread "main" com.hazelcast.config.InvalidConfigurationException: cvc-type.3.1.1: Element 'global-serializer' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'override-java-serialization' was found. at com.hazelcast.config.AbstractXmlConfigHelper.schemaValidation(AbstractXmlConfigHelper.java:189) at com.hazelcast.client.config.XmlClientConfigBuilder.parseAndBuildConfig(XmlClientConfigBuilder.java:194) at com.hazelcast.client.config.XmlClientConfigBuilder.build(XmlClientConfigBuilder.java:174) at com.hazelcast.client.config.XmlClientConfigBuilder.build(XmlClientConfigBuilder.java:167) at com.db.hz.subzero.HazelcastSubzeroClient.main(HazelcastSubzeroClient.java:16)

Hazelcast.xml:

`<hazelcast xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hazelcast.com/schema/config http://www.hazelcast.com/schema/config/hazelcast-config-3.11.xsd" xmlns="http://www.hazelcast.com/schema/config">

<network>
    <join>
        <multicast enabled="false" />
        <tcp-ip enabled="true">
            <member>127.0.0.1:5701</member>
        </tcp-ip>
    </join>
</network>
<serialization>
<serializers>
    <global-serializer override-java-serialization="true">info.jerrinot.subzero.Serializer</global-serializer> 
`

Hazelcast-client.xml:

<?xml version="1.0" encoding="UTF-8"?> <hazelcast-client xsi:schemaLocation="http://www.hazelcast.com/schema/client-config hazelcast-client-config-3.6.xsd" xmlns="http://www.hazelcast.com/schema/client-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <network> <cluster-members> <address>127.0.0.1:5701</address> </cluster-members> </network> <serialization> <serializers> <global-serializer override-java-serialization="true">info.jerrinot.subzero.Serializer</global-serializer> </serializers> </serialization> </hazelcast-client>

Its work fine if configure pro-grammatically, but fail with xml configuration . Hazelcast node is starting properly with this xml configuration, client is throwing error , please suggest ?

Thanks Mukul

mukul4u2005 avatar Nov 28 '18 21:11 mukul4u2005

hi @mukul4u2005,

what is your Hazelcast version? I can see you are using 3.6 in your XSD. Your XML references this schema: <?xml version="1.0" encoding="UTF-8"?> <hazelcast-client xsi:schemaLocation="http://www.hazelcast.com/schema/client-config hazelcast-client-config-3.6.xsd"

I guess this schema does not have the override-java-serialization attribute. Can you try it with a new schema?

jerrinot avatar Dec 12 '18 14:12 jerrinot