You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Max Pfingsthorn <m....@hippo.nl> on 2006/03/01 13:30:34 UTC

RE: environment errors

Hi!

Okay, I traced this one to the o.a.c.environment.wrapper.EnvironmentWrapper (thank god for debuggers). That one does not implement release(Source) itself, so the superclass is used, but since it is a wrapper, it is not initialized to have a source resolver itself! I am not sure what this class is used for, but can I just forward the call to the wrapped environment like some of the other methods do?

max

> Number two:
> 
> This one seems to be caused by a missing source resolver, 
> which I cannot imagine at all. Why would the environment 
> wrapped by the MutableEnvironmentFacade not be initialized 
> correctly (i.e. have no source resolver)?
> 
> java.lang.NullPointerException
>        at 
> org.apache.cocoon.environment.AbstractEnvironment.release(Abst
> ractEnvironment.java:565)
>        at 
> org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade
> .release(MutableEnvironmentFacade.java:308)
>        at 
> org.apache.cocoon.transformation.TraxTransformer.recycle(TraxT
> ransformer.java:548)
>        at 
> org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingP
> ool.put(InstrumentedResourceLimitingPool.java:407)
>        at 
> org.apache.avalon.excalibur.component.PoolableComponentHandler
> .doPut(PoolableComponentHandler.java:212)
>        at 
> org.apache.avalon.excalibur.component.ComponentHandler.put(Com
> ponentHandler.java:425)
>        at 
> org.apache.avalon.excalibur.component.ExcaliburComponentSelect
> or.release(ExcaliburComponentSelector.java:307)
>        at 
> org.apache.cocoon.components.ExtendedComponentSelector.release
> (ExtendedComponentSelector.java:300)
>        at 
> org.apache.cocoon.components.ExtendedComponentSelector.release
> (ExtendedComponentSelector.java:297)
>        at 
> org.apache.cocoon.components.ExtendedComponentSelector.release
> (ExtendedComponentSelector.java:297)
>        at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeli
> ne.recycle(AbstractProcessingPipeline.java:732)
>        at 
> org.apache.cocoon.components.pipeline.impl.BaseCachingProcessi
> ngPipeline.recycle(BaseCachingProcessingPipeline.java:77)
>        at 
> org.apache.cocoon.components.pipeline.impl.AbstractCachingProc
> essingPipeline.recycle(AbstractCachingProcessingPipeline.java:993)
>        at 
> org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingP
> ool.put(InstrumentedResourceLimitingPool.java:407)
>        at 
> org.apache.avalon.excalibur.component.PoolableComponentHandler
> .doPut(PoolableComponentHandler.java:212)
>        at 
> org.apache.avalon.excalibur.component.ComponentHandler.put(Com
> ponentHandler.java:425)
>        at 
> org.apache.avalon.excalibur.component.ExcaliburComponentSelect
> or.release(ExcaliburComponentSelector.java:307)
>        at 
> org.apache.cocoon.components.ExtendedComponentSelector.release
> (ExtendedComponentSelector.java:300)
>        at 
> org.apache.cocoon.components.ExtendedComponentSelector.release
> (ExtendedComponentSelector.java:297)
>        at 
> org.apache.cocoon.components.EnvironmentDescription.release(Co
> coonComponentManager.java:678)
>        at 
> org.apache.cocoon.components.CocoonComponentManager.endProcess
> ing(CocoonComponentManager.java:243)
>        at org.apache.cocoon.Cocoon.process(Cocoon.java:719)
>        at 
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.
> java:1154)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
>        at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.do
> Filter(WebApplicationHandler.java:830)
>        at 
> nl.hippo.util.ResponseEncodingFilter.doFilter(ResponseEncoding
> Filter.java:36)
>        at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.do
> Filter(WebApplicationHandler.java:821)
>        at 
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebAp
> plicationHandler.java:471)
>        at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler
> .java:568)
>        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>        at 
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebAppl
> icationContext.java:633)
>        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>        at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>        at 
> org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
>        at 
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
>        at 
> org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
>        at 
> org.mortbay.http.SocketListener.handleConnection(SocketListene
> r.java:244)
>        at 
> org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>        at 
> org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Re: environment errors

Posted by Carsten Ziegeler <cz...@apache.org>.
Max Pfingsthorn schrieb:
> Hi!
> 
> Okay, I traced this one to the o.a.c.environment.wrapper.EnvironmentWrapper
> thank god for debuggers). That one does not implement release(Source)
itself,
>so the superclass is used, but since it is a wrapper, it is not initialized to 
>have a source resolver itself! I am not sure what this class is used for, but can I 
>just forward the call to the wrapped environment like some of the other
methods do?
> 
Hmm, no, I think this is then just a workaround for the real problem.
If the source resolver is null in release it either means that the
resolveURI was never called before, so a source is tried to be released
on a different env than it was looked up from. Or in the other case,
finishProcessing() has been called prior to the release method. Then the
order of method calls is wrong.

Can you come up with a test case?

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/