This issue has been created
 
 
URL Normalizer / cid:jira-generated-image-avatar-8f2093b4-8062-41e0-bcfc-ec54a4ad4f63 URLNORMALZ-38 Open

URLNormalizer fails to work if installed in two different (Sub)wikis

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3f0222f9-c439-44dd-b7aa-9ba9e59a8ac8 Clemens Robbenhaar created this issue on 10/Jul/24 00:33
 
Summary: URLNormalizer fails to work if installed in two different (Sub)wikis
Issue Type: cid:jira-generated-image-avatar-8f2093b4-8062-41e0-bcfc-ec54a4ad4f63 Bug
Affects Versions: 1.8.2
Assignee: Unassigned
Created: 10/Jul/24 00:33
Priority: cid:jira-generated-image-static-major-8d1a99e4-5100-45ad-b213-493c1c9abe18 Major
Reporter: Clemens Robbenhaar
Description:

The reason for this is that the cache is created with the same name for both wikis:

Cache with name [urlnormalizer.configuration] already exist        
[...]
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.contrib.urlnormalizer.internal.configuration.URLNormalizerConfigurationStore] identified by type [class org.xwiki.contrib.urlnormalizer.internal.configuration.URLNormalizerConfigurationStore] and hint [default]
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:204)
    at org.xwiki.component.embed.GenericProvider.getInstance(GenericProvider.java:111)
    at org.xwiki.component.embed.GenericProvider.get(GenericProvider.java:100)
    ... 68 common frames omitted
Caused by: org.xwiki.component.phase.InitializationException: Failed to create URL Normalizer Configuration cache
    at org.xwiki.contrib.urlnormalizer.internal.configuration.URLNormalizerConfigurationStore.initialize(URLNormalizerConfigurationStore.java:111)
    at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
    at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:365)
    at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:451)
    at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:201)
    ... 70 common frames omitted
Caused by: org.xwiki.cache.CacheException: Cache with name [urlnormalizer.configuration] already exist
    at org.xwiki.cache.infinispan.internal.InfinispanCacheFactory.newCache(InfinispanCacheFactory.java:152)
    at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:112)
    at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:85)
    at org.xwiki.contrib.urlnormalizer.internal.configuration.URLNormalizerConfigurationStore.initialize(URLNormalizerConfigurationStore.java:109)
    ... 74 common frames omitted
 

Afterwards the URLNormalizer only works in one of the wikis, whichever gets initialzied first.

The easiest fix seems to be to install the org.xwiki.contrib:application-urlnormalizer-api only in the ROOT namespace. If this is not possible as cache keys are not unique across subwikis, maybe add the wiki name to the cache.