You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/11/16 15:04:00 UTC

[jira] [Commented] (KNOX-804) Knox ehcache usage has intermittent CacheManger exception

    [ https://issues.apache.org/jira/browse/KNOX-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16689526#comment-16689526 ] 

ASF subversion and git services commented on KNOX-804:
------------------------------------------------------

Commit 1846718 from krisden@apache.org in branch 'knox/trunk'
[ https://svn.apache.org/r1846718 ]

KNOX-804 - KNOX-1165 - Update documentation for org.apache.knox.gateway.shirorealm.KnoxCacheManager

> Knox ehcache usage has intermittent CacheManger exception
> ---------------------------------------------------------
>
>                 Key: KNOX-804
>                 URL: https://issues.apache.org/jira/browse/KNOX-804
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server, Site
>    Affects Versions: 0.10.0
>            Reporter: Sumit Gupta
>            Assignee: Sumit Gupta
>            Priority: Major
>             Fix For: 0.11.0
>
>
> There is an intermittent issue when using ehcache in the shiro config. It doesn't seem to happen in a new topology file.
> {code:java}
> 2016-10-10 08:22:09,171 ERROR env.EnvironmentLoader (EnvironmentLoader.java:initEnvironment(146)) - Shiro environment initialization failed
>  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@42caa857
>  at org.apache.shiro.cache.ehcache.EhCacheManager.ensureCacheManager(EhCacheManager.java:224)
>  at org.apache.shiro.cache.ehcache.EhCacheManager.init(EhCacheManager.java:199)
>  at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)
>  at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)
>  at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:61)
>  at org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:129)
>  at org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)
>  at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)
>  at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)
>  at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)
>  at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
>  at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
>  at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
>  at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)
>  at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)
>  at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)
>  at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)
>  at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)
>  at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221)
>  at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:133)
>  at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)
>  at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
>  at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
>  at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
>  at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
>  at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
>  at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
>  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
>  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
>  at org.apache.hadoop.gateway.GatewayServer.internalDeploy(GatewayServer.java:364)
>  at org.apache.hadoop.gateway.GatewayServer.access$700(GatewayServer.java:72)
>  at org.apache.hadoop.gateway.GatewayServer$InternalTopologyListener.handleCreateDeployment(GatewayServer.java:441)
>  at org.apache.hadoop.gateway.GatewayServer$InternalTopologyListener.handleTopologyEvent(GatewayServer.java:402)
>  at org.apache.hadoop.gateway.services.topology.impl.DefaultTopologyService.notifyChangeListeners(DefaultTopologyService.java:347)
>  at org.apache.hadoop.gateway.services.topology.impl.DefaultTopologyService.reloadTopologies(DefaultTopologyService.java:321)
>  at org.apache.hadoop.gateway.services.topology.impl.DefaultTopologyService.onFileChange(DefaultTopologyService.java:418)
>  at org.apache.commons.io.monitor.FileAlterationObserver.doMatch(FileAlterationObserver.java:400)
>  at org.apache.commons.io.monitor.FileAlterationObserver.checkAndNotify(FileAlterationObserver.java:334)
>  at org.apache.commons.io.monitor.FileAlterationObserver.checkAndNotify(FileAlterationObserver.java:304)
>  at org.apache.commons.io.monitor.FileAlterationMonitor.run(FileAlterationMonitor.java:182)
>  at java.lang.Thread.run(Thread.java:745)
>  Caused by: 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@42caa857
>  at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:460)
>  at net.sf.ehcache.CacheManager.init(CacheManager.java:349)
>  at net.sf.ehcache.CacheManager.<init>(CacheManager.java:317)
>  at org.apache.shiro.cache.ehcache.EhCacheManager.ensureCacheManager(EhCacheManager.java:213)
>  ... 40 more{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)