[KEYCLOAK-12097] Fix NPE when trying to obtain the cache container name from jboss-web.xml
- check if the cache name as configured in jboss-web.xml is composite - i.e. has a 'parent.child' structure
This commit is contained in:
parent
44b489b571
commit
fd9c4e9228
2 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ public class KeycloakClusteredSsoDeploymentProcessor implements DeploymentUnitPr
|
||||||
// Update names from jboss-web.xml's <replicationConfig>
|
// Update names from jboss-web.xml's <replicationConfig>
|
||||||
if (webMetaData.getReplicationConfig() != null && webMetaData.getReplicationConfig().getCacheName() != null) {
|
if (webMetaData.getReplicationConfig() != null && webMetaData.getReplicationConfig().getCacheName() != null) {
|
||||||
ServiceName sn = ServiceName.parse(webMetaData.getReplicationConfig().getCacheName());
|
ServiceName sn = ServiceName.parse(webMetaData.getReplicationConfig().getCacheName());
|
||||||
cacheContainer = sn.getParent().getSimpleName();
|
cacheContainer = (sn.length() > 1) ? sn.getParent().getSimpleName() : sn.getSimpleName();
|
||||||
deploymentSessionCacheName = sn.getSimpleName();
|
deploymentSessionCacheName = sn.getSimpleName();
|
||||||
}
|
}
|
||||||
String ssoCacheName = deploymentSessionCacheName + ".ssoCache";
|
String ssoCacheName = deploymentSessionCacheName + ".ssoCache";
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class KeycloakClusteredSsoDeploymentProcessor implements DeploymentUnitPr
|
||||||
// Update names from jboss-web.xml's <replicationConfig>
|
// Update names from jboss-web.xml's <replicationConfig>
|
||||||
if (webMetaData.getReplicationConfig() != null && webMetaData.getReplicationConfig().getCacheName() != null) {
|
if (webMetaData.getReplicationConfig() != null && webMetaData.getReplicationConfig().getCacheName() != null) {
|
||||||
ServiceName sn = ServiceName.parse(webMetaData.getReplicationConfig().getCacheName());
|
ServiceName sn = ServiceName.parse(webMetaData.getReplicationConfig().getCacheName());
|
||||||
cacheContainer = sn.getParent().getSimpleName();
|
cacheContainer = (sn.length() > 1) ? sn.getParent().getSimpleName() : sn.getSimpleName();
|
||||||
deploymentSessionCacheName = sn.getSimpleName();
|
deploymentSessionCacheName = sn.getSimpleName();
|
||||||
}
|
}
|
||||||
String ssoCacheName = deploymentSessionCacheName + ".ssoCache";
|
String ssoCacheName = deploymentSessionCacheName + ".ssoCache";
|
||||||
|
|
Loading…
Reference in a new issue