Hi, Appreciate if you can guide me whether it's safe/appropriate to use the CurrentContext rather than the ThreadLocalCarbonContext, to get the username and tenant domain.
I'm not much knowledgeable about the design, but I feel using it will be "plastering" the root cause. Thanks, Dulanja On Wed, Jan 9, 2013 at 12:18 PM, Dulanja Liyanage <[email protected]> wrote: > Hi Shariq, > > I did as you suggested and now the username is available. > > What I'm not sure is how appropriate/safe this is. > > Thanks for the help. > > Regards, > Dulanja > > > On Tue, Jan 8, 2013 at 6:17 PM, Dulanja Liyanage <[email protected]> wrote: > >> Hi Shariq, >> >> I will try that. Thanks! >> >> Dulanja >> >> >> On Tue, Jan 8, 2013 at 6:12 PM, Muhammed Shariq <[email protected]> wrote: >> >>> Hi, >>> >>> This looks like an issue I encountered sometime back. We had to revert >>> the fixes I did in TomcatValve cz it was causing some other issue .. Can >>> you try CarbonContext.getCurrentContext.getUsername() and see what happens >>> .. AFAIR its getUsername simple does a return .. we should fix it to check >>> if username is null and if so set it properly .. usually that is the >>> behavior but there are some edge cases it seem ... >>> >>> On Tue, Jan 8, 2013 at 3:53 PM, Dulanja Liyanage <[email protected]>wrote: >>> >>>> Hi, >>>> >>>> I'm testing IS 4.1.0 running on Carbon 4.0.6. While debugging an issue, >>>> I encountered the $subject. >>>> >>>> I logged in as 'admin', so, the username should return as such. But it >>>> returns 'null'. >>>> >>>> However the >>>> PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain() >>>> returns 'carbon.super' as expected. >>>> >>>> I'm still debugging this and trying to figure out how CarbonContext >>>> works in threads. If someone is already aware of a reason/solution for this >>>> it will save time. :) >>>> >>>> Thanks! >>>> Dulanja >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >>> >>> -- >>> Thanks, >>> Shariq. >>> Phone: +94 777 202 225 >>> >> >> >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
