If I remember correctly, earlier we had an Axis2 handler that use to set
the proper CarbonContext so it used to work even for nhttp transport. It is
just a matter of looking at the request & creating the proper CarbonContext
thread local variable. Such a handler is not needed for other products
because a Tomcat valve does this.

Azeez

On Wed, Aug 29, 2012 at 10:15 PM, Miyuru Wanninayaka <[email protected]>wrote:

> See [1]
> SuperTenantCarbonContext.getCurrentContext().getTenantDomain(true) returns
> null, which will cause NPE. Probably this will happen only in ESB because
> when request in coming via NHTTP transport, there is no carbon context
> associated with it.
>
> [1]
> http://wso2.org/svn/browse/wso2/carbon/platform/branches/4.0.0/components/stratos/org.wso2.carbon.stratos.landing.page.deployer/2.0.1/src/main/java/org/wso2/carbon/stratos/landing/page/deployer/LandingPageWebappDeployer.java?view=diff&r1=137887&r2=137888&pathrev=137888
>
> On Wed, Aug 29, 2012 at 6:22 PM, Kasun Indrasiri <[email protected]> wrote:
>
>>  After every restart, we have to login to the tenant at lease once.
>> Otherwise get the following exception :
>>
>> [2012-08-29 17:56:57,295] ERROR - TenantAxisUtils Error occurred while
>> running deployment for tenant kasun.com
>> java.lang.NullPointerException
>> at
>> org.wso2.carbon.stratos.landing.page.deployer.LandingPageWebappDeployer.init(LandingPageWebappDeployer.java:46)
>>  at
>> org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1165)
>> at
>> org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1154)
>>  at
>> org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
>> at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:287)
>>  at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:121)
>> at
>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:161)
>>  at
>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:68)
>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
>>  at
>> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
>> at
>> org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)
>>  at
>> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)
>> at
>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>>  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)
>> [2012-08-29 17:56:57,297] ERROR - ServerWorker Error processing POST
>> request
>> java.lang.RuntimeException: Cannot create tenant ConfigurationContext for
>> tenant kasun.com
>>  at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:124)
>> at
>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:161)
>>  at
>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:68)
>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
>>  at
>> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
>> at
>> org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)
>>  at
>> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)
>> at
>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>>  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)
>> Caused by: java.lang.Exception: Error occurred while running deployment
>> for tenant
>> at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:335)
>>  at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:121)
>> ... 10 more
>> Caused by: java.lang.NullPointerException
>> at
>> org.wso2.carbon.stratos.landing.page.deployer.LandingPageWebappDeployer.init(LandingPageWebappDeployer.java:46)
>>  at
>> org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:1165)
>> at
>> org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:1154)
>>  at
>> org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:89)
>> at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:287)
>>  ... 11 more
>>
>>
>> --
>> Kasun Indrasiri
>> Associate Technical Lead
>> WSO2, Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> cell: +94 71 536 4128
>> Blog : http://kasunpanorama.blogspot.com/
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thanks,
> Miyuru
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*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*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to