diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakClusteredSsoDeploymentProcessor.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakClusteredSsoDeploymentProcessor.java index 0333bc9dee..a0f0f10baf 100644 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakClusteredSsoDeploymentProcessor.java +++ b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakClusteredSsoDeploymentProcessor.java @@ -113,7 +113,7 @@ public class KeycloakClusteredSsoDeploymentProcessor implements DeploymentUnitPr // Update names from jboss-web.xml's if (webMetaData.getReplicationConfig() != null && webMetaData.getReplicationConfig().getCacheName() != null) { ServiceName sn = ServiceName.parse(webMetaData.getReplicationConfig().getCacheName()); - cacheContainer = sn.getParent().getSimpleName(); + cacheContainer = (sn.length() > 1) ? sn.getParent().getSimpleName() : sn.getSimpleName(); deploymentSessionCacheName = sn.getSimpleName(); } String ssoCacheName = deploymentSessionCacheName + ".ssoCache"; diff --git a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakClusteredSsoDeploymentProcessor.java b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakClusteredSsoDeploymentProcessor.java index 3be66deb79..47c5b98c08 100644 --- a/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakClusteredSsoDeploymentProcessor.java +++ b/adapters/saml/wildfly/wildfly-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakClusteredSsoDeploymentProcessor.java @@ -116,7 +116,7 @@ public class KeycloakClusteredSsoDeploymentProcessor implements DeploymentUnitPr // Update names from jboss-web.xml's if (webMetaData.getReplicationConfig() != null && webMetaData.getReplicationConfig().getCacheName() != null) { ServiceName sn = ServiceName.parse(webMetaData.getReplicationConfig().getCacheName()); - cacheContainer = sn.getParent().getSimpleName(); + cacheContainer = (sn.length() > 1) ? sn.getParent().getSimpleName() : sn.getSimpleName(); deploymentSessionCacheName = sn.getSimpleName(); } String ssoCacheName = deploymentSessionCacheName + ".ssoCache";