You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Amir Rosen <am...@cti2.com> on 2003/01/01 10:04:29 UTC

RE: [BUG] : java.util.EmptyStackException on EnvironmentStack

Hi,

I added a patch in my servlet extending the cocoon servlet, detailed below.

Is this going to solve this bug ?


public class SensesServlet extends CocoonServlet {
...
	public void service(ServletRequest request, ServletResponse response)
			throws ServletException, IOException {
		EnvironmentStack es = CocoonComponentManager.getCurrentEnvironmentStack();
		if (es != null) {
			es.clear();
			es.resetOffset(0);
		}
		super.service(request, response);
	}

Thanks,

Amir Rosen


> -----Original Message-----
> From: Amir Rosen 
> Sent: Tuesday, December 31, 2002 2:57 PM
> To: cocoon-dev@xml.apache.org
> Subject: [BUG] : java.util.EmptyStackException on EnvironmentStack
> 
> 
> Hi,
> 
> I'm using cocoon 2.0.4, and after calling a request that causes 
> an exception, sometimes I get an EmptyStackException 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, but I'm not sure if
> that is the right solution. (I'm not fluent with the behavior
> of this part of the system)
> 
> Please help me solve this.
> 
> 
> Thanks,
> 
> Amir Rosen
> CTI Squared
> amir@cti2.com
> +972-9-9605200 (258)
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org