DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15843>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15843

EmptyStackException in EnvironmentStack

           Summary: EmptyStackException in EnvironmentStack
           Product: Cocoon 2
           Version: 2.0.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: core
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


After calling a request that causes an exception, sometimes 
EmptyStackException is thrown from the environment stack.

I traced this behavior, and found out that, the environment
stack is sometimes not initialized, when the request is 
just starting to process, meaning, on the first call to
CocoonComponentManager#enterEnvironment, environmentStack.get()
returns an empty EnvironmentStack with offset = 1.

I think resetting the thread's EnvironmentStack on entry
(CocoonServlet#service) will solve this.

adding the following code in the beginning of CocoonServlet#service, seems to 
patch this behavior:

EnvironmentStack es = CocoonComponentManager.getCurrentEnvironmentStack();
if (es != null) {
    es.clear();
    es.resetOffset(0);
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to