Hi Knox community,
I am having some problems with a Knox instance that hosts two Knox topologies.
In each topology, an LDAP connection is configured. After enabling caching
using the following attributes, this error occurs when using one of the two
topologies. The other one works fine:
WARN webapp.WebAppContext (WebAppContext.java:doStart(514)) - Failed startup
of context
o.e.j.w.WebAppContext@514646ef{/gateway/dev,file:/var/lib/knox/data-2.5.0.0-1245/deployments/dev.topo.1588c20be90/%252F/,STARTING}{/usr/hdp/2.5.0.0-1245/knox/bin/../data/deployments/dev.topo.1588c20be90/%2F}
org.apache.shiro.cache.CacheException: net.sf.ehcache.CacheException: Another
unnamed CacheManager already exists in the same VM. Please provide unique names
for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same
CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: InputStreamConfigurationSource
[stream=sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@78a287ed]
The config extract is:
<!-- The following three options enable LDAP caching -->
<param>
<name>main.cacheManager</name>
<value>org.apache.shiro.cache.ehcache.EhCacheManager</value>
</param>
<param>
<name>main.securityManager.cacheManager</name>
<value>$cacheManager</value>
</param>
<param>
<name>main.ldapRealm.authenticationCachingEnabled</name>
<value>true</value>
</param>
</provider>
Is there a way to use two non-conflicting cache providers? Maybe by naming them?
Or otherwise: Is the cache provider shared by all topologies?
Best regards and thanks for your help,
Benjamin