Hi Mohan,

You can get Theadlocal CC by
*PrivilegedCarbonContext.getThreadLocalCarbonContext();
* This will create a Thread.ocal CC and populate it if it is null, After
that you can set tenant domain and tenant Id by
PrivilegedCarbonContext.setTenantDomain(..); and
PrivilegedCarbonContext.setTenantId(...);

eg: for super tenant
PrivilegedCarbonContext.setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
PrivilegedCarbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);


Thanks,
Shameera.


On Fri, Aug 16, 2013 at 11:12 AM, Afkham Azeez <[email protected]> wrote:

> Please make sure that the correct CC is created & populated before the
> execution of this code. Ideally, every thread in the system should have an
> associated CC.
>
> Azeez
>
>
> On Fri, Aug 16, 2013 at 11:11 AM, Mohanadarshan Vivekanandalingam <
> [email protected]> wrote:
>
>> Hi,
>>
>> I'm getting the following exception when trying to run a sample in newly
>> build CEP 3.0.0...
>>
>> [2013-08-16 10:33:47,274] ERROR
>> {org.apache.thrift.server.TThreadPoolServer} -  Error occurred during
>> processing of message.
>> java.lang.NullPointerException: Tenant domain has not been set in
>> CarbonContext
>> at
>> org.wso2.carbon.caching.impl.CacheManagerFactoryImpl.getCacheManager(CacheManagerFactoryImpl.java:79)
>>  at
>> org.wso2.carbon.registry.core.utils.RegistryUtils.getCacheManager(RegistryUtils.java:289)
>> at
>> org.wso2.carbon.registry.core.utils.RegistryUtils.getResourceCache(RegistryUtils.java:272)
>>  at
>> org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getCache(CacheBackedRegistry.java:62)
>> at
>> org.wso2.carbon.registry.core.caching.CacheBackedRegistry.resourceExists(CacheBackedRegistry.java:246)
>>  at
>> org.wso2.carbon.registry.core.session.UserRegistry.resourceExists(UserRegistry.java:629)
>> at
>> org.wso2.carbon.databridge.streamdefn.registry.datastore.RegistryStreamDefinitionStore.getAllStreamDefinitionsFromStore(RegistryStreamDefinitionStore.java:109)
>>  at
>> org.wso2.carbon.databridge.core.definitionstore.AbstractStreamDefinitionStore.getAllStreamDefinitions(AbstractStreamDefinitionStore.java:53)
>> at
>> org.wso2.carbon.databridge.core.internal.EventDispatcher.initDomainNameStreamTypeHolderCache(EventDispatcher.java:201)
>>  at
>> org.wso2.carbon.databridge.core.internal.EventDispatcher.getStreamDefinitionHolder(EventDispatcher.java:167)
>> at
>> org.wso2.carbon.databridge.core.internal.EventDispatcher.findStreamId(EventDispatcher.java:254)
>>  at
>> org.wso2.carbon.databridge.core.DataBridge.findStreamId(DataBridge.java:104)
>> at
>> org.wso2.carbon.databridge.receiver.thrift.service.ThriftEventTransmissionServiceImpl.findStreamId(ThriftEventTransmissionServiceImpl.java:64)
>>  at
>> org.wso2.carbon.databridge.commons.thrift.service.general.ThriftEventTransmissionService$Processor$findStreamId.getResult(ThriftEventTransmissionService.java:466)
>>  at
>> org.wso2.carbon.databridge.commons.thrift.service.general.ThriftEventTransmissionService$Processor$findStreamId.getResult(ThriftEventTransmissionService.java:454)
>>  at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
>> at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
>>  at
>> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>  at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> at java.lang.Thread.run(Thread.java:662)
>>
>>
>> Is there any reason for this? Is it possible to disable the caching in
>> the the registry which used by CEP?
>>
>>
>>
>> --
>> *V. Mohanadarshan*
>> *Software Engineer,*
>> *Data Technologies Team,*
>> *WSO2, Inc. http://wso2.com *
>> *lean.enterprise.middleware.*
>> *
>> *
>> email: [email protected]
>> phone:(+94) 771117673
>>
>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>**
> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>



-- 
*Software Engineer - WSO2 Inc.*
*email: shameera AT wso2.com <[email protected]> , shameera AT
apache.org<[email protected]>
*
*phone:  +9471 922 1454*
*
*
*Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561
*Twitter     : *https://twitter.com/Shameera_R
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to