This sounds like a bug. When a tenant is deleted, the cache should be cleared automatically. You shouldn't have to wait for the periodic cache cleanup.
My suggestion is to write a TenantMgtListener extension, and add it to the product. In there, you can add a cache clearing operation for the tenant pre/post delete method. On Monday, November 7, 2016, wenxzhen <wenxing.zh...@qq.com> wrote: > Dear all, > > I am trying to remove a Tenant from the WSO2, but I found the following > exception after removing a Tenant and then re-create it: > > Caused by: java.lang.SecurityException: Illegal access attempt to cache ] > owned by tenant {[testdomain7],[17]} by tenant {[testdomain7],[18]} > at org.wso2.carbon.caching.impl.Util.checkAccess(Util.java:46) > at org.wso2.carbon.caching.impl.CarbonCacheManager.getCache( > CarbonCacheManager.java:111) > at org.wso2.carbon.registry.core.utils.RegistryUtils. > getResourceCache(RegistryUtils.java:297) > at org.wso2.carbon.registry.core.caching.CacheBackedRegistry. > getCache(CacheBackedRegistry.java:62) > at org.wso2.carbon.registry.core.caching.CacheBackedRegistry. > resourceExists(CacheBackedRegistry.java:289) > at org.wso2.carbon.registry.core.session.UserRegistry. > resourceExistsInternal(UserRegistry.java:770) > at org.wso2.carbon.registry.core.session.UserRegistry.access$ > 800(UserRegistry.java:60) > at org.wso2.carbon.registry.core.session.UserRegistry$9.run( > UserRegistry.java:753) > at org.wso2.carbon.registry.core.session.UserRegistry$9.run( > UserRegistry.java:750) > at java.security.AccessController.doPrivileged(Native Method) > at org.wso2.carbon.registry.core.session.UserRegistry. > resourceExists(UserRegistry.java:750) > ... 62 more > > My question is how I can remove the related Registry cache of a tenant? > Thank you very much. > > Regards, Wenxing > > -- *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc. email: kasung AT spamfree wso2.com linked-in: http://lk.linkedin.com/in/gajasinghe blog: http://kasunbg.org phone: +1 650-745-4499, 77 678 0813
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev