cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck <stuart.roeb...@adolos.co.uk>
Subject [C2] Possible bug in SitemapComponentSelector.select() ?
Date Wed, 01 Aug 2001 17:30:19 GMT
Trying hard to debug things without having to understand all the ins and 
outs of Avalon and Cocoon, I think I may have tracked problems down to 
something.

In SitemapComponentSelector.java, the select method is as follows:

>     public Component select(Object hint) throws ComponentException {
>         Component component = null;
>
>         try {
>             component = super.select(hint);
>         } catch (ComponentException ce) {
>             if (this.parentSelector != null) {
>                 component = this.parentSelector.select(hint);
>             } else {
>                 throw ce;
>             }
>         }
>
>         return component;
>     }

this.parentSelector.select(hint) is called if super.select(hint) throws a 
ComponentException, but if super.select() is using a 
PoolableComponentHandler, it is going to prefer to expand its pool than 
return with an exception, so the second call is not going to happen.

Now I really haven't had time to get my head round what parents are and 
what the difference is between a Handler a Manager a Factory, etc., but if 
I'm guessing correctly, then may be this means that in a sitemap situation 
like:

>     <map:match pattern="news-*.html">
>       <map:aggregate element="aggregate">
>         <map:part src="cocoon:/general_info.xml" element="general" />
>         <map:part src="cocoon:/select/news/{1}.xml" element="news" />
>         <!-- <map:part src="cocoon:/images-news.xml" element="images-news"
>  /> -->
>       </map:aggregate>
>       <map:transform src="transform/specific/prepare_news_page.xslt" />
>       <map:transform src="transform/general/docbook_article.xslt" />
>       <map:transform src="transform/specific/site_look.xslt" />
>       <map:serialize/>
>     </map:match>
...
>     <map:match pattern="select/*/*.xml">
>       <map:generate type="serverpages" 
> src="cocoon:/create-data_select_xsp/{1}.xml">
>         <map:parameter name="idtext" value="{2}" />
>       </map:generate>
>       <map:serialize type="xml" />
>     </map:match>
>

A request for "new-test_news.html" is going to request 
"cocoon:/select/news/test_news.xml" which, during its processing is going 
to look for JaxpTransformer components from its own pool before that of 
its parent.  Consequently, on every call it is going to create a whole new 
pool and set of transformers.

I really am guessing a lot here, and my terminology is probably all wrong,
  but I'm really keen to sort this one out!

Here's a stack dump of an occurence of this issue corresponding to the 
example above.  The stack dump is not due to any error, its just a dump on 
entry to the JaxpParser.newDocument() call:

>   [1] org.apache.cocoon.components.parser.JaxpParser.newDocument 
> (JaxpParser.java:79)
>   [2] 
> org.apache.cocoon.components.browser.BrowserImpl.createDocumentForBrowserInfo 
> (BrowserImpl.java:393)
>   [3] org.apache.cocoon.components.browser.BrowserImpl.compose 
> (BrowserImpl.java:156)
>   [4] 
> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance 
> (DefaultComponentFactory.java:98)
>   [5] org.apache.avalon.excalibur.component.DefaultComponentHandler.get 
> (DefaultComponentHandler.java:92)
>   [6] 
> org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup 
> (ExcaliburComponentManager.java:266)
>   [7] 
> org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup 
> (ExcaliburComponentManager.java:223)
>   [8] org.apache.cocoon.transformation.TraxTransformer.compose 
> (TraxTransformer.java:334)
>   [9] 
> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance 
> (DefaultComponentFactory.java:98)
>   [10] org.apache.avalon.excalibur.pool.AbstractPool.newPoolable 
> (AbstractPool.java:70)
>   [11] org.apache.avalon.excalibur.pool.SoftResourceLimitingPool.grow 
> (SoftResourceLimitingPool.java:82)
>   [12] org.apache.avalon.excalibur.pool.DefaultPool.get (DefaultPool.java:
> 125)
>   [13] org.apache.avalon.excalibur.component.PoolableComponentHandler.get 
> (PoolableComponentHandler.java:117)
>   [14] 
> org.apache.avalon.excalibur.component.ExcaliburComponentSelector.select 
> (ExcaliburComponentSelector.java:246)
>   [15] org.apache.cocoon.sitemap.SitemapComponentSelector.select 
> (SitemapComponentSelector.java:49)
>   [16] 
> org.apache.cocoon.components.pipeline.AbstractEventPipeline.addTransformer 
> (AbstractEventPipeline.java:95)
>   [17] 
> org.apache.cocoon.components.pipeline.CachingEventPipeline.addTransformer 
> (CachingEventPipeline.java:93)
>   [18] org.apache.cocoon.www.file_.Users.stuart.Documents.Clients.Adolos.
> Adolos_Website.Development.webapp.sitemap_xmap.wildcardMatchN334 
> (sitemap_xmap.java:3108)
>   [19] org.apache.cocoon.www.file_.Users.stuart.Documents.Clients.Adolos.
> Adolos_Website.Development.webapp.sitemap_xmap.process (sitemap_xmap.java:
> 1467)
>   [20] org.apache.cocoon.www.file_.Users.stuart.Documents.Clients.Adolos.
> Adolos_Website.Development.webapp.sitemap_xmap.process (sitemap_xmap.java:
> 1346)
>   [21] org.apache.cocoon.components.source.SitemapSource.refresh 
> (SitemapSource.java:247)
>   [22] org.apache.cocoon.components.source.SitemapSource.<init> 
> (SitemapSource.java:145)
>   [23] org.apache.cocoon.components.source.CocoonSourceFactory.getSource 
> (CocoonSourceFactory.java:53)
>   [24] org.apache.cocoon.components.source.SourceHandlerImpl.getSource 
> (SourceHandlerImpl.java:132)
>   [25] org.apache.cocoon.environment.AbstractEnvironment.resolve 
> (AbstractEnvironment.java:229)
>   [26] org.apache.cocoon.environment.wrapper.EnvironmentWrapper.resolve 
> (EnvironmentWrapper.java:222)
>   [27] 
> org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load 
> (ProgramGeneratorImpl.java:141)
>   [28] org.apache.cocoon.generation.ServerPagesGenerator.setup 
> (ServerPagesGenerator.java:153)
>   [29] 
> org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline 
> (AbstractEventPipeline.java:146)
>   [30] org.apache.cocoon.components.pipeline.CachingEventPipeline.setup 
> (CachingEventPipeline.java:246)
>   [31] 
> org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey 
> (CachingEventPipeline.java:108)
>   [32] org.apache.cocoon.components.source.SitemapSource.refresh 
> (SitemapSource.java:259)
>   [33] org.apache.cocoon.components.source.SitemapSource.<init> 
> (SitemapSource.java:145)
>   [34] org.apache.cocoon.components.source.CocoonSourceFactory.getSource 
> (CocoonSourceFactory.java:53)
>   [35] org.apache.cocoon.components.source.SourceHandlerImpl.getSource 
> (SourceHandlerImpl.java:132)
>   [36] org.apache.cocoon.environment.AbstractEnvironment.resolve 
> (AbstractEnvironment.java:229)
>   [37] org.apache.cocoon.sitemap.ContentAggregator.setup 
> (ContentAggregator.java:284)
>   [38] 
> org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline 
> (AbstractEventPipeline.java:146)
>   [39] org.apache.cocoon.components.pipeline.CachingEventPipeline.setup 
> (CachingEventPipeline.java:246)
>   [40] 
> org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey 
> (CachingEventPipeline.java:108)
>   [41] 
> org.apache.cocoon.components.pipeline.CachingStreamPipeline.process 
> (CachingStreamPipeline.java:279)
>   [42] org.apache.cocoon.www.file_.Users.stuart.Documents.Clients.Adolos.
> Adolos_Website.Development.webapp.sitemap_xmap.wildcardMatchN1DD 
> (sitemap_xmap.java:2057)
>   [43] org.apache.cocoon.www.file_.Users.stuart.Documents.Clients.Adolos.
> Adolos_Website.Development.webapp.sitemap_xmap.process (sitemap_xmap.java:
> 1387)
>   [44] org.apache.cocoon.www.file_.Users.stuart.Documents.Clients.Adolos.
> Adolos_Website.Development.webapp.sitemap_xmap.process (sitemap_xmap.java:
> 1330)
>   [45] org.apache.cocoon.sitemap.Handler.process (Handler.java:160)
>   [46] org.apache.cocoon.sitemap.Manager.invoke (Manager.java:103)
>   [47] org.apache.cocoon.Cocoon.process (Cocoon.java:423)
>   [48] org.apache.cocoon.servlet.CocoonServlet.service 
> (CocoonServlet.java:507)
>   [49] javax.servlet.http.HttpServlet.service (HttpServlet.java:853)
>   [50] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
> (ApplicationFilterChain.java:247)
>   [51] org.apache.catalina.core.ApplicationFilterChain.doFilter 
> (ApplicationFilterChain.java:193)
>   [52] org.apache.catalina.core.StandardWrapperValve.invoke 
> (StandardWrapperValve.java:243)
>   [53] org.apache.catalina.core.StandardPipeline.invokeNext 
> (StandardPipeline.java:566)
>   [54] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.
> java:472)
>   [55] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:
> 943)
>   [56] org.apache.catalina.core.StandardContextValve.invoke 
> (StandardContextValve.java:219)
>   [57] org.apache.catalina.core.StandardPipeline.invokeNext 
> (StandardPipeline.java:566)
>   [58] org.apache.catalina.valves.CertificatesValve.invoke 
> (CertificatesValve.java:246)
>   [59] org.apache.catalina.core.StandardPipeline.invokeNext 
> (StandardPipeline.java:564)
>   [60] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.
> java:472)
>   [61] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:
> 943)
>   [62] org.apache.catalina.core.StandardContext.invoke 
> (StandardContext.java:2251)
>   [63] org.apache.catalina.core.StandardHostValve.invoke 
> (StandardHostValve.java:164)
>   [64] org.apache.catalina.core.StandardPipeline.invokeNext 
> (StandardPipeline.java:566)
>   [65] org.apache.catalina.valves.AccessLogValve.invoke 
> (AccessLogValve.java:446)
>   [66] org.apache.catalina.core.StandardPipeline.invokeNext 
> (StandardPipeline.java:564)
>   [67] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.
> java:472)
>   [68] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:
> 943)
>   [69] org.apache.catalina.core.StandardEngineValve.invoke 
> (StandardEngineValve.java:163)
>   [70] org.apache.catalina.core.StandardPipeline.invokeNext 
> (StandardPipeline.java:566)
>   [71] org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.
> java:472)
>   [72] org.apache.catalina.core.ContainerBase.invoke (ContainerBase.java:
> 943)
>   [73] org.apache.catalina.connector.http.HttpProcessor.process 
> (HttpProcessor.java:984)
>   [74] org.apache.catalina.connector.http.HttpProcessor.run 
> (HttpProcessor.java:1074)
>   [75] java.lang.Thread.run (Thread.java:496)

Thoughts?

Stuart.

-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Lead Developer                               Java, XML, MacOS X, XP, etc.
ADOLOS                                           <http://www.adolos.com/>

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


Mime
View raw message