cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15843] New: - EmptyStackException in EnvironmentStack
Date Tue, 07 Jan 2003 15:49:56 GMT
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: cocoon-dev@xml.apache.org
        ReportedBy: amir@cti2.com


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: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message