Take a look at this for inspiration: http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/java/com/flowlogix/security/WebSecurityFilter.java
You have to conditionally initialize Shiro.. On Mar 19, 2013, at 11:43 AM, Bernhard Hirschmann wrote: > Oops - the problem is not solved yet... > > When enabling the EhCacheManager, then it throws an error, indicating that > Shiro is already initialized... > > 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=com.ibm.ws.classloader.Handler$ZipEntryInputStream@7328c022] > at > net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:565) > at net.sf.ehcache.CacheManager.init(CacheManager.java:389) > at net.sf.ehcache.CacheManager.<init>(CacheManager.java:352) > at > org.apache.shiro.cache.ehcache.EhCacheManager.ensureCacheManager(EhCacheManager.java:213) > > > So the big question is: > Why do I have this problem in an MDB? > > or: > What do I have to do to initialize the MDB environment correctly for Shiro? > (although the EJB container is working fine already with Shiro, since in a > session bean it is working - see first posting) > > Any help highly appreciated. > > > > > -- > View this message in context: > http://shiro-user.582556.n2.nabble.com/UnavailableSecurityManagerException-in-MDB-tp7578445p7578460.html > Sent from the Shiro User mailing list archive at Nabble.com. >
