You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by vo...@basf-it-services.com on 2002/03/15 11:04:44 UTC

TreeProcessor reloads sitemap.xmap every time


Hi,

I found a problem in the new TreeProcessor Sitemap implementation (sitemap.xmap
reloaded every time).
The bug is in "org.apache.cocoon.components.treeprocessor.sitemap.MountNode"

private synchronized TreeProcessor getProcessor(Environment env, String source)
throws Exception {

        TreeProcessor processor = (TreeProcessor)processors.get(source);

        if (processor == null) {

            if (source.charAt(source.length() - 1) == '/') {
                source = source + "sitemap.xmap";
            }

            processor = this.parentProcessor.createChildProcessor(
                this.manager, this.language, env.resolve(source));

            processors.put(source, processor);
        }

        return processor;
    }

If source ends with "/",  the "processor.get(source)" is done with the original
source but the "processors.put(source, processor)" is done with 'source + "
sitemap.xmap"'. So the get never matches the put.

Volker



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


Re: TreeProcessor reloads sitemap.xmap every time

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
volker.schmitt@basf-it-services.com wrote:

>
>Hi,
>
>I found a problem in the new TreeProcessor Sitemap implementation (sitemap.xmap
>reloaded every time).
>The bug is in "org.apache.cocoon.components.treeprocessor.sitemap.MountNode"
>
>private synchronized TreeProcessor getProcessor(Environment env, String source)
>throws Exception {
>
>        TreeProcessor processor = (TreeProcessor)processors.get(source);
>
>        if (processor == null) {
>
>            if (source.charAt(source.length() - 1) == '/') {
>                source = source + "sitemap.xmap";
>            }
>
>            processor = this.parentProcessor.createChildProcessor(
>                this.manager, this.language, env.resolve(source));
>
>            processors.put(source, processor);
>        }
>
>        return processor;
>    }
>
>If source ends with "/",  the "processor.get(source)" is done with the original
>source but the "processors.put(source, processor)" is done with 'source + "
>sitemap.xmap"'. So the get never matches the put.
>
>Volker
>
Corrected ! Thanks for reporting.

Sylvain

-- 
Sylvain Wallez
  Anyware Technologies                  Apache Cocoon
  http://www.anyware-tech.com           mailto:sylvain@apache.org




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


Re: TreeProcessor reloads sitemap.xmap every time

Posted by Stuart Roebuck <st...@adolos.co.uk>.
This sounds promising with respect to our current problems - which look 
increasing like they may be tree-processor related.

What circumstances would lead to source ending in "/"?  (in other words, 
how does the source variable here relate to entries in the sitemap ?)

Do you think this might this relate to the abundance of...

> HttpProcessor[8080][4]/DefaultComponentFactory: ComponentFactory
> decommissioning instance of
> org.apache.cocoon.components.treeprocessor.CategoryNodeBuilder.

entries in my sitemap log?

Stuart.

On Friday, March 15, 2002, at 10:04 am, volker.schmitt@basf-it-
services.com wrote:

>
>
> Hi,
>
> I found a problem in the new TreeProcessor Sitemap implementation 
> (sitemap.xmap
> reloaded every time).
> The bug is in 
> "org.apache.cocoon.components.treeprocessor.sitemap.MountNode"
>
> private synchronized TreeProcessor getProcessor(Environment env, String 
> source)
> throws Exception {
>
>         TreeProcessor processor = (TreeProcessor)processors.get(source);
>
>         if (processor == null) {
>
>             if (source.charAt(source.length() - 1) == '/') {
>                 source = source + "sitemap.xmap";
>             }
>
>             processor = this.parentProcessor.createChildProcessor(
>                 this.manager, this.language, env.resolve(source));
>
>             processors.put(source, processor);
>         }
>
>         return processor;
>     }
>
> If source ends with "/",  the "processor.get(source)" is done with the 
> original
> source but the "processors.put(source, processor)" is done with 
> 'source + "
> sitemap.xmap"'. So the get never matches the put.
>
> Volker

            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             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