apereo/cas · error

Using Hazelcast WAN Replication requires a Hazelcast…

Error message

Using Hazelcast WAN Replication requires a Hazelcast Enterprise subscription. Make sure you have acquired the proper license, SDK and tooling from Hazelcast before activating this feature.

What it means

HazelcastConfigurationFactory.build throws IllegalArgumentException when WAN replication is enabled in the CAS Hazelcast cluster settings but no Hazelcast license key is configured. WAN Replication is a Hazelcast Enterprise-only feature; the factory first rejects the configuration, and would otherwise warn that an Enterprise subscription (license, SDK, tooling) is required. Startup fails rather than silently running WAN replication on an open-source distribution.

Solutions

  1. Obtain and set a valid Hazelcast Enterprise license key in the Hazelcast core settings (hz.core.license-key / cas.ticket.registry.hazelcast.core.licenseKey).
  2. If you do not have an Enterprise subscription, disable WAN replication: set cluster.wanReplication.enabled=false.
  3. Verify the license-key property is actually bound (check property path/nesting in the config model) — a typo silently leaves it empty.
  4. Consider alternatives available in open-source Hazelcast (e.g. user-code-deployment free features or manual sync) if Enterprise is not an option.

Example fix

// before
// cas.ticket.registry.hazelcast.cluster.wanReplication.enabled=true
// (no license key set)
// after
cas.ticket.registry.hazelcast.cluster.wanReplication.enabled=true
cas.ticket.registry.hazelcast.core.license-key=HAZELCAST_ENTERPRISE_LICENSE_STRING
Defensive patterns

Strategy: validation

Validate before calling

// Validate before enabling WAN replication
var wan = casProperties.getTicket().getRegistry().getHazelcast().getCluster().getWanReplication();
var license = casProperties.getTicket().getRegistry().getHazelcast().getCore().getLicenseKey();
if (wan.isEnabled() && (license == null || license.isBlank())) {
    throw new IllegalStateException("WAN replication enabled but hazelcast license-key is missing");
}

Prevention

When it happens

Trigger: config -> build when cas.monitor/hazelcast cluster.wan-replication.enabled=true while hz.getCore().getLicenseKey() is blank. Any configuration path that enables WAN replication (e.g. cas.ticket.registry.hazelcast.cluster.wanReplication.enabled=true) without setting a license key.

Common situations: Copying a community config sample that enables WAN replication; enabling the flag expecting open-source support; setting licenseKey under the wrong property namespace so StringUtils.hasText sees empty; Hazelcast SDK 4.x license not applied via the core settings.

Related errors


AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08). Data as JSON: /api/errors/dc2ee34033572a31. Report an issue: GitHub.

Appendix: source

Thrown at support/cas-server-support-hazelcast-core/src/main/java/org/apereo/cas/hz/HazelcastConfigurationFactory.java:130

            StringUtils.commaDelimitedListToSet(cluster.getNetwork().getNetworkInterfaces())
                .forEach(faceIp -> networkConfig.getInterfaces().addInterface(faceIp));
        }

        if (StringUtils.hasText(cluster.getNetwork().getLocalAddress())) {
            config.setProperty(BaseHazelcastProperties.HAZELCAST_LOCAL_ADDRESS_PROP, cluster.getNetwork().getLocalAddress());
        }
        if (StringUtils.hasText(cluster.getNetwork().getPublicAddress())) {
            config.setProperty(BaseHazelcastProperties.HAZELCAST_PUBLIC_ADDRESS_PROP, cluster.getNetwork().getPublicAddress());
            networkConfig.setPublicAddress(cluster.getNetwork().getPublicAddress());
        }

        cluster.getNetwork().getOutboundPorts().forEach(networkConfig::addOutboundPortDefinition);

        if (cluster.getWanReplication().isEnabled()) {
            if (!StringUtils.hasText(hz.getCore().getLicenseKey())) {
                throw new IllegalArgumentException("Cannot activate WAN replication, a Hazelcast enterprise feature, without a license key");
            }
            LOGGER.warn("Using Hazelcast WAN Replication requires a Hazelcast Enterprise subscription. Make sure you "
                + "have acquired the proper license, SDK and tooling from Hazelcast before activating this feature.");
            buildWanReplicationSettingsForConfig(hz, config);
        }

        val joinConfig = cluster.getDiscovery().isEnabled()
            ? createDiscoveryJoinConfig(config, cluster, networkConfig)
            : createDefaultJoinConfig(cluster);
        LOGGER.trace("Created Hazelcast join configuration [{}]", joinConfig);
        networkConfig.setJoin(joinConfig);

        LOGGER.trace("Created Hazelcast network configuration [{}]", networkConfig);
        config.setNetworkConfig(networkConfig);
        config.getSerializationConfig().setEnableCompression(hz.getCore().isEnableCompression());
        config.getSerializationConfig().setUseNativeByteOrder(true);
        config.getSerializationConfig().setAllowUnsafe(true);
        
        val instanceName = StringUtils.hasText(cluster.getCore().getInstanceName())
            ? SpringExpressionLanguageValueResolver.getInstance().resolve(cluster.getCore().getInstanceName())

View on GitHub (pinned to e7288fc434)