Hazelcast Management Center can't connect to cluster when providing custom serializer

43 views Asked by At

Hazelcast Version: 4.2.7 Management Center Version: 5.3.6 Running on Windows via mc-start.cmd in binaries.

I'm trying to configure connection to my cluster that's running on 127.0.0.1:15701 like this:

<?xml version="1.0" encoding="UTF-8"?>
<hazelcast-client xmlns="http://www.hazelcast.com/schema/client-config"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://www.hazelcast.com/schema/client-config
                  http://www.hazelcast.com/schema/client-config/hazelcast-client-config-5.3.xsd">

    <network>
        <cluster-members>
            <address>127.0.0.1:15701</address>
        </cluster-members>
        <smart-routing>true</smart-routing>
    </network>
    <cluster-name>cross-shard</cluster-name>
    <connection-strategy>
        <connection-retry>
            <cluster-connect-timeout-millis>1000</cluster-connect-timeout-millis>
        </connection-retry>
    </connection-strategy>


    <serialization>
        <allow-override-default-serializers>true</allow-override-default-serializers>
        <serializers>  
            <serializer type-class="my.package.MyObject"
                class-name="my.package.MySerializer"/>
        </serializers>
    </serialization>
</hazelcast-client>

JARs containing MyObject and MySerializer are included in ./user-lib, and I'm adding cluster settings like this

.\mc-conf.bat cluster add --client-config=./hazelcast-client.xml -v

or via management center GUI, results are the same

However, cluster connection remain in status "Disconnected" and there is no errors in terminal running MC whatsoever. Running "Diagnose" results in an infinite load and no errors are displayed either.

If I remove <serialization> section it works just fine, but my goal is to set up custom serialization, for MyObject in cluster is serialized with MySerializer, and I want it to be displayed in maps.

I should mention that I thought it might be some problem with my jars, but other objects except for MyObject are deserialized just fine. Also, attemt to set up default com.hazelcast.internal.serialization.impl.defaultserializers.ConstantSerializers.TheByteArraySerializer instead of MySerializer yields the same results.

(Like this)

    <serialization>
        <allow-override-default-serializers>true</allow-override-default-serializers>
        <serializers>  
            <serializer type-class="java.lang.StringBuilder"
                class-name="com.hazelcast.internal.serialization.impl.defaultserializers.ConstantSerializers.TheByteArraySerializer"/>
        </serializers>
    </serialization>

MyObject is Serializable, MySerializer implements ByteArraySerializer

Any tips where I can look to find out what's wrong?

0

There are 0 answers