Re: [Dev] How to clear up the Registry Cache?

2016-11-08 Thread wenxzhen
Thanks to Rajith.


I hope we don't have the 15 mins limitation, and would like to make sure the 
cache will not refer to the old tenant after removal.


Where can I find the background job per 15 mins interval you mentioned?


Regards, Wenxing


-- Original --
From:  "Rajith Roshan";<raji...@wso2.com>;
Send time: Tuesday, Nov 8, 2016 3:29 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi ,

You don't need to explicitly clear the registry cache. The cache will 
automatically invalidate within 15 minutes. Or the cache will be cleared when 
server is re started. 
The issue you are facing is trying to access the cache using newly crated 
tenant which causing a security issue. Seems like the owner of cache instance 
still the old tenant. 


Thanks!
Rajith


On Tue, Nov 8, 2016 at 8:48 AM, wenxzhen <wenxing.zh...@qq.com> wrote:
Dear experts,


Please advice a way to clear up the Registry Cache, which is really good to 
have.


Thanks, Wenxing




-- Original --
From:  "wenxzhen";<wenxing.zh...@qq.com>;
Date:  Nov 7, 2016
To:  "wenxzhen"<wenxing.zh...@qq.com>; "Rajith Roshan"<raji...@wso2.com>; 
Cc:  "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?





Appreciated if anyone can shed some light on how to clear up the Registry Cache.


Thanks, Wenxing


-- Original --
From:  "wenxzhen";<wenxing.zh...@qq.com>;
Date:  Nov 7, 2016
To:  "Rajith Roshan"<raji...@wso2.com>; 
Cc:  "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi Rajith,


You are right, there is no well defined way. Before deleting the UM data and 
Registry data, I have already deactivated the tenant. 


The exception below happened on my re-creation of the tenant with the same 
name. Please advice whether it's the problem that the Registry cache was not 
cleared up?


Thanks, Wenxing




-- Original --
From:  "Rajith Roshan";<raji...@wso2.com>;
Send time: Monday, Nov 7, 2016 2:22 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "KasunG Gajasinghe"<kas...@wso2.com>; "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi,

ASFAIK there is no well defined way to delete a tenant. You can deactivate a 
tenant. If you are using custom code then this error may be due to starting a 
wrong tenant flow in your code. 


Thanks!
Rajith


On Mon, Nov 7, 2016 at 10:46 AM, wenxzhen <wenxing.zh...@qq.com> wrote:
Thanks to Lakshani and Kasun.



Regarding the TenantMgtListener extension, any reference or example to do the 
cache clearing since our application is a WEB application?


Thanks again, Wenxing




------ Original --
From:  "KasunG Gajasinghe";<kas...@wso2.com>;
Send time: Monday, Nov 7, 2016 1:43 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?





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.c

Re: [Dev] How to clear up the Registry Cache?

2016-11-07 Thread Rajith Roshan
Hi ,

You don't need to explicitly clear the registry cache. The cache will
automatically invalidate within 15 minutes. Or the cache will be cleared
when server is re started.
The issue you are facing is trying to access the cache using newly crated
tenant which causing a security issue. Seems like the owner of cache
instance still the old tenant.

Thanks!
Rajith

On Tue, Nov 8, 2016 at 8:48 AM, wenxzhen <wenxing.zh...@qq.com> wrote:

> Dear experts,
>
> Please advice a way to clear up the Registry Cache, which is really good
> to have.
>
> Thanks, Wenxing
>
>
> -- Original --
> *From: * "wenxzhen";<wenxing.zh...@qq.com>;
> *Date: * Nov 7, 2016
> *To: * "wenxzhen"<wenxing.zh...@qq.com>; "Rajith Roshan"<raji...@wso2.com>;
>
> *Cc: * "dev"<dev@wso2.org>;
> *Subject: * Re: [Dev] How to clear up the Registry Cache?
>
> Appreciated if anyone can shed some light on how to clear up the Registry
> Cache.
>
> Thanks, Wenxing
>
> -- Original --
> *From: * "wenxzhen";<wenxing.zh...@qq.com>;
> *Date: * Nov 7, 2016
> *To: * "Rajith Roshan"<raji...@wso2.com>;
> *Cc: * "dev"<dev@wso2.org>;
> *Subject: * Re: [Dev] How to clear up the Registry Cache?
>
> Hi Rajith,
>
> You are right, there is no well defined way. Before deleting the UM data
> and Registry data, I have already deactivated the tenant.
>
> The exception below happened on my re-creation of the tenant with the same
> name. Please advice whether it's the problem that the Registry cache was
> not cleared up?
>
> Thanks, Wenxing
>
>
> -- Original ----------
> *From: * "Rajith Roshan";<raji...@wso2.com>;
> *Send time:* Monday, Nov 7, 2016 2:22 PM
> *To:* "wenxzhen"<wenxing.zh...@qq.com>;
> *Cc:* "KasunG Gajasinghe"<kas...@wso2.com>; "dev"<dev@wso2.org>;
> *Subject: * Re: [Dev] How to clear up the Registry Cache?
>
> Hi,
>
> ASFAIK there is no well defined way to delete a tenant. You can deactivate
> a tenant. If you are using custom code then this error may be due to
> starting a wrong tenant flow in your code.
>
> Thanks!
> Rajith
>
> On Mon, Nov 7, 2016 at 10:46 AM, wenxzhen <wenxing.zh...@qq.com> wrote:
>
>> Thanks to Lakshani and Kasun.
>>
>> Regarding the TenantMgtListener extension, any reference or example to do
>> the cache clearing since our application is a WEB application?
>>
>> Thanks again, Wenxing
>>
>>
>> -- Original --
>> *From: * "KasunG Gajasinghe";<kas...@wso2.com>;
>> *Send time:* Monday, Nov 7, 2016 1:43 PM
>> *To:* "wenxzhen"<wenxing.zh...@qq.com>;
>> *Cc:* "dev"<dev@wso2.org>;
>> *Subject: * Re: [Dev] How to clear up the Registry Cache?
>>
>>
>> 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(Car
>>> bonCacheManager.java:111)
>>> at org.wso2.carbon.registry.core.utils.RegistryUtils.getResourc
>>> eCache(RegistryUtils.java:297)
>>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.ge
>>> tCache(CacheBackedRegistry.java:62)
>>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.re
>>> sourceExists(CacheBackedRegistry.java:289)
>>> at org.wso2.carbon.registry.core.session.UserRegistry.resourceE
>>> xistsInternal(UserRegistry.java:770)
>>> at org.wso2.carbon.registry.core.session.UserRegistry.access$80
>>> 0(UserRegistry.java:60)
>>> at org.wso2.carbon.registry.core.session.UserRegistry$9.run(Use

Re: [Dev] How to clear up the Registry Cache?

2016-11-07 Thread wenxzhen
Dear experts,


Please advice a way to clear up the Registry Cache, which is really good to 
have.


Thanks, Wenxing




-- Original --
From:  "wenxzhen";<wenxing.zh...@qq.com>;
Date:  Nov 7, 2016
To:  "wenxzhen"<wenxing.zh...@qq.com>; "Rajith Roshan"<raji...@wso2.com>; 
Cc:  "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Appreciated if anyone can shed some light on how to clear up the Registry Cache.


Thanks, Wenxing


-- Original --
From:  "wenxzhen";<wenxing.zh...@qq.com>;
Date:  Nov 7, 2016
To:  "Rajith Roshan"<raji...@wso2.com>; 
Cc:  "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi Rajith,


You are right, there is no well defined way. Before deleting the UM data and 
Registry data, I have already deactivated the tenant. 


The exception below happened on my re-creation of the tenant with the same 
name. Please advice whether it's the problem that the Registry cache was not 
cleared up?


Thanks, Wenxing




-- Original --
From:  "Rajith Roshan";<raji...@wso2.com>;
Send time: Monday, Nov 7, 2016 2:22 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "KasunG Gajasinghe"<kas...@wso2.com>; "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi,

ASFAIK there is no well defined way to delete a tenant. You can deactivate a 
tenant. If you are using custom code then this error may be due to starting a 
wrong tenant flow in your code. 


Thanks!
Rajith


On Mon, Nov 7, 2016 at 10:46 AM, wenxzhen <wenxing.zh...@qq.com> wrote:
Thanks to Lakshani and Kasun.



Regarding the TenantMgtListener extension, any reference or example to do the 
cache clearing since our application is a WEB application?


Thanks again, Wenxing




-- Original ----------
From:  "KasunG Gajasinghe";<kas...@wso2.com>;
Send time: Monday, Nov 7, 2016 1:43 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?





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
 





-- 
Rajith Roshan

Software Engineer, WSO2 Inc.
 Mobile: +94-72-642-8350___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to clear up the Registry Cache?

2016-11-07 Thread wenxzhen
Dear experts,


Please advice a way to clear up the Registry Cache, which is really good to 
have.


Thanks, Wenxing




-- Original --
From:  "wenxzhen";<wenxing.zh...@qq.com>;
Date:  Nov 7, 2016
To:  "wenxzhen"<wenxing.zh...@qq.com>; "Rajith Roshan"<raji...@wso2.com>; 
Cc:  "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Appreciated if anyone can shed some light on how to clear up the Registry Cache.


Thanks, Wenxing


-- Original --
From:  "wenxzhen";<wenxing.zh...@qq.com>;
Date:  Nov 7, 2016
To:  "Rajith Roshan"<raji...@wso2.com>; 
Cc:  "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi Rajith,


You are right, there is no well defined way. Before deleting the UM data and 
Registry data, I have already deactivated the tenant. 


The exception below happened on my re-creation of the tenant with the same 
name. Please advice whether it's the problem that the Registry cache was not 
cleared up?


Thanks, Wenxing




-- Original --
From:  "Rajith Roshan";<raji...@wso2.com>;
Send time: Monday, Nov 7, 2016 2:22 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "KasunG Gajasinghe"<kas...@wso2.com>; "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi,

ASFAIK there is no well defined way to delete a tenant. You can deactivate a 
tenant. If you are using custom code then this error may be due to starting a 
wrong tenant flow in your code. 


Thanks!
Rajith


On Mon, Nov 7, 2016 at 10:46 AM, wenxzhen <wenxing.zh...@qq.com> wrote:
Thanks to Lakshani and Kasun.



Regarding the TenantMgtListener extension, any reference or example to do the 
cache clearing since our application is a WEB application?


Thanks again, Wenxing




-- Original ----------
From:  "KasunG Gajasinghe";<kas...@wso2.com>;
Send time: Monday, Nov 7, 2016 1:43 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?





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
 





-- 
Rajith Roshan

Software Engineer, WSO2 Inc.
 Mobile: +94-72-642-8350___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to clear up the Registry Cache?

2016-11-07 Thread wenxzhen
Appreciated if anyone can shed some light on how to clear up the Registry Cache.


Thanks, Wenxing


-- Original --
From:  "wenxzhen";<wenxing.zh...@qq.com>;
Date:  Nov 7, 2016
To:  "Rajith Roshan"<raji...@wso2.com>; 
Cc:  "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi Rajith,


You are right, there is no well defined way. Before deleting the UM data and 
Registry data, I have already deactivated the tenant. 


The exception below happened on my re-creation of the tenant with the same 
name. Please advice whether it's the problem that the Registry cache was not 
cleared up?


Thanks, Wenxing




-- Original --
From:  "Rajith Roshan";<raji...@wso2.com>;
Send time: Monday, Nov 7, 2016 2:22 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "KasunG Gajasinghe"<kas...@wso2.com>; "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi,

ASFAIK there is no well defined way to delete a tenant. You can deactivate a 
tenant. If you are using custom code then this error may be due to starting a 
wrong tenant flow in your code. 


Thanks!
Rajith


On Mon, Nov 7, 2016 at 10:46 AM, wenxzhen <wenxing.zh...@qq.com> wrote:
Thanks to Lakshani and Kasun.



Regarding the TenantMgtListener extension, any reference or example to do the 
cache clearing since our application is a WEB application?


Thanks again, Wenxing




-- Original --
From:  "KasunG Gajasinghe";<kas...@wso2.com>;
Send time: Monday, Nov 7, 2016 1:43 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?





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
 





-- 
Rajith Roshan

Software Engineer, WSO2 Inc.
 Mobile: +94-72-642-8350___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to clear up the Registry Cache?

2016-11-06 Thread wenxzhen
Hi Rajith,


You are right, there is no well defined way. Before deleting the UM data and 
Registry data, I have already deactivated the tenant. 


The exception below happened on my re-creation of the tenant with the same 
name. Please advice whether it's the problem that the Registry cache was not 
cleared up?


Thanks, Wenxing




-- Original --
From:  "Rajith Roshan";<raji...@wso2.com>;
Send time: Monday, Nov 7, 2016 2:22 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "KasunG Gajasinghe"<kas...@wso2.com>; "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?



Hi,

ASFAIK there is no well defined way to delete a tenant. You can deactivate a 
tenant. If you are using custom code then this error may be due to starting a 
wrong tenant flow in your code. 


Thanks!
Rajith


On Mon, Nov 7, 2016 at 10:46 AM, wenxzhen <wenxing.zh...@qq.com> wrote:
Thanks to Lakshani and Kasun.



Regarding the TenantMgtListener extension, any reference or example to do the 
cache clearing since our application is a WEB application?


Thanks again, Wenxing




-- Original --
From:  "KasunG Gajasinghe";<kas...@wso2.com>;
Send time: Monday, Nov 7, 2016 1:43 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?





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
 





-- 
Rajith Roshan

Software Engineer, WSO2 Inc.
 Mobile: +94-72-642-8350___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to clear up the Registry Cache?

2016-11-06 Thread Rajith Roshan
Hi,

ASFAIK there is no well defined way to delete a tenant. You can deactivate
a tenant. If you are using custom code then this error may be due to
starting a wrong tenant flow in your code.

Thanks!
Rajith

On Mon, Nov 7, 2016 at 10:46 AM, wenxzhen <wenxing.zh...@qq.com> wrote:

> Thanks to Lakshani and Kasun.
>
> Regarding the TenantMgtListener extension, any reference or example to do
> the cache clearing since our application is a WEB application?
>
> Thanks again, Wenxing
>
>
> -- Original --
> *From: * "KasunG Gajasinghe";<kas...@wso2.com>;
> *Send time:* Monday, Nov 7, 2016 1:43 PM
> *To:* "wenxzhen"<wenxing.zh...@qq.com>;
> *Cc:* "dev"<dev@wso2.org>;
> *Subject: * Re: [Dev] How to clear up the Registry Cache?
>
>
> 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(Car
>> bonCacheManager.java:111)
>> at org.wso2.carbon.registry.core.utils.RegistryUtils.getResourc
>> eCache(RegistryUtils.java:297)
>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.ge
>> tCache(CacheBackedRegistry.java:62)
>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.re
>> sourceExists(CacheBackedRegistry.java:289)
>> at org.wso2.carbon.registry.core.session.UserRegistry.resourceE
>> xistsInternal(UserRegistry.java:770)
>> at org.wso2.carbon.registry.core.session.UserRegistry.access$80
>> 0(UserRegistry.java:60)
>> at org.wso2.carbon.registry.core.session.UserRegistry$9.run(Use
>> rRegistry.java:753)
>> at org.wso2.carbon.registry.core.session.UserRegistry$9.run(Use
>> rRegistry.java:750)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at org.wso2.carbon.registry.core.session.UserRegistry.resourceE
>> xists(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
>
>


-- 
Rajith Roshan
Software Engineer, WSO2 Inc.
Mobile: +94-72-642-8350 <%2B94-71-554-8430>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to clear up the Registry Cache?

2016-11-06 Thread wenxzhen
Thanks to Lakshani and Kasun.



Regarding the TenantMgtListener extension, any reference or example to do the 
cache clearing since our application is a WEB application?


Thanks again, Wenxing




-- Original --
From:  "KasunG Gajasinghe";<kas...@wso2.com>;
Send time: Monday, Nov 7, 2016 1:43 PM
To: "wenxzhen"<wenxing.zh...@qq.com>; 
Cc: "dev"<dev@wso2.org>; 
Subject:  Re: [Dev] How to clear up the Registry Cache?





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


Re: [Dev] How to clear up the Registry Cache?

2016-11-06 Thread KasunG Gajasinghe
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  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


Re: [Dev] How to clear up the Registry Cache?

2016-11-06 Thread Lakshani Gamage
Hi Wenxing,

Registry cache clears in every 15 min. Or you have to restart the server.

Thanks,
Lakshani

On Mon, Nov 7, 2016 at 8:22 AM, wenxzhen  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
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Lakshani Gamage

*Software Engineer, WSO2*

*Mobile : +94 71 5478184 <%2B94%20%280%29%20773%20451194>*
*Blog : http://lakshanigamage.blogspot.com/
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] How to clear up the Registry Cache?

2016-11-06 Thread wenxzhen
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___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev