{"record":{"id":"dc2ee34033572a31","repo":"apereo/cas","slug":"using-hazelcast-wan-replication-requires-a-hazelca","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"support/cas-server-support-hazelcast-core/src/main/java/org/apereo/cas/hz/HazelcastConfigurationFactory.java","lineNumber":130,"sourceCode":"            StringUtils.commaDelimitedListToSet(cluster.getNetwork().getNetworkInterfaces())\n                .forEach(faceIp -> networkConfig.getInterfaces().addInterface(faceIp));\n        }\n\n        if (StringUtils.hasText(cluster.getNetwork().getLocalAddress())) {\n            config.setProperty(BaseHazelcastProperties.HAZELCAST_LOCAL_ADDRESS_PROP, cluster.getNetwork().getLocalAddress());\n        }\n        if (StringUtils.hasText(cluster.getNetwork().getPublicAddress())) {\n            config.setProperty(BaseHazelcastProperties.HAZELCAST_PUBLIC_ADDRESS_PROP, cluster.getNetwork().getPublicAddress());\n            networkConfig.setPublicAddress(cluster.getNetwork().getPublicAddress());\n        }\n\n        cluster.getNetwork().getOutboundPorts().forEach(networkConfig::addOutboundPortDefinition);\n\n        if (cluster.getWanReplication().isEnabled()) {\n            if (!StringUtils.hasText(hz.getCore().getLicenseKey())) {\n                throw new IllegalArgumentException(\"Cannot activate WAN replication, a Hazelcast enterprise feature, without a license key\");\n            }\n            LOGGER.warn(\"Using Hazelcast WAN Replication requires a Hazelcast Enterprise subscription. Make sure you \"\n                + \"have acquired the proper license, SDK and tooling from Hazelcast before activating this feature.\");\n            buildWanReplicationSettingsForConfig(hz, config);\n        }\n\n        val joinConfig = cluster.getDiscovery().isEnabled()\n            ? createDiscoveryJoinConfig(config, cluster, networkConfig)\n            : createDefaultJoinConfig(cluster);\n        LOGGER.trace(\"Created Hazelcast join configuration [{}]\", joinConfig);\n        networkConfig.setJoin(joinConfig);\n\n        LOGGER.trace(\"Created Hazelcast network configuration [{}]\", networkConfig);\n        config.setNetworkConfig(networkConfig);\n        config.getSerializationConfig().setEnableCompression(hz.getCore().isEnableCompression());\n        config.getSerializationConfig().setUseNativeByteOrder(true);\n        config.getSerializationConfig().setAllowUnsafe(true);\n        \n        val instanceName = StringUtils.hasText(cluster.getCore().getInstanceName())\n            ? SpringExpressionLanguageValueResolver.getInstance().resolve(cluster.getCore().getInstanceName())","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-hazelcast-core/src/main/java/org/apereo/cas/hz/HazelcastConfigurationFactory.java#L112-L148","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Obtain and set a valid Hazelcast Enterprise license key in the Hazelcast core settings (hz.core.license-key / cas.ticket.registry.hazelcast.core.licenseKey).","If you do not have an Enterprise subscription, disable WAN replication: set cluster.wanReplication.enabled=false.","Verify the license-key property is actually bound (check property path/nesting in the config model) — a typo silently leaves it empty.","Consider alternatives available in open-source Hazelcast (e.g. user-code-deployment free features or manual sync) if Enterprise is not an option."],"exampleFix":"// before\n// cas.ticket.registry.hazelcast.cluster.wanReplication.enabled=true\n// (no license key set)\n// after\ncas.ticket.registry.hazelcast.cluster.wanReplication.enabled=true\ncas.ticket.registry.hazelcast.core.license-key=HAZELCAST_ENTERPRISE_LICENSE_STRING","handlingStrategy":"validation","validationCode":"// Validate before enabling WAN replication\nvar wan = casProperties.getTicket().getRegistry().getHazelcast().getCluster().getWanReplication();\nvar license = casProperties.getTicket().getRegistry().getHazelcast().getCore().getLicenseKey();\nif (wan.isEnabled() && (license == null || license.isBlank())) {\n    throw new IllegalStateException(\"WAN replication enabled but hazelcast license-key is missing\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only enable WAN replication if you hold a Hazelcast Enterprise license.","Verify the license key property path in the CAS config model — typos leave it silently empty.","Add a startup assertion (or integration test) that fails fast when Enterprise features are enabled without a license.","Keep license keys in environment variables/secrets, and confirm they are actually bound to the Spring property."],"tags":["hazelcast","license","configuration","enterprise-feature"],"backgroundTag":"missing-license-key","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}