Hi,

I am working on [1] and found that the cause of the exception mentioned
below is in the code segment in
org.wso2.carbon.context.internal.CarbonContextDataHolder
in carbon.utils.

public void endTenantFlow() {

    Stack<CarbonContextDataHolder> carbonContextDataHolders =
parentContextHolderStack.get();
    if (carbonContextDataHolders != null) {
        currentContextHolder.set(carbonContextDataHolders.pop());
    }
}

*Exception :*

java.util.EmptyStackException
        at java.util.Stack.peek(Stack.java:102)
        at java.util.Stack.pop(Stack.java:84)
        at 
org.wso2.carbon.context.internal.CarbonContextDataHolder.endTenantFlow(CarbonContextDataHolder.java:1291)
        at 
org.wso2.carbon.context.PrivilegedCarbonContext.endTenantFlow(PrivilegedCarbonContext.java:75)
        at 
org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:69)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

Issue occurs when it tries to pop elements from
carbonContextDataHolders stack when it is empty.

Is it a possible scenario that this stack being empty and shouldn't it
be handled at CarbonContextDataHolder (check isEmpty in stack)?

[1] - https://wso2.org/jira/browse/ESBJAVA-3832

Thanks

-- 
Jagath Ariyarathne
Technical Lead
WSO2 Inc.  http://wso2.com/
Email: [email protected]
Mob  : +94 77 386 7048
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to