You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Pablo Barrera <ba...@gsyc.es> on 2008/09/16 12:22:23 UTC

Dispatcher cache deactivation not working

Hello

I am trying to modify an structurer but every time I make a change I  
have to reboot forrest, otherwise I don't see the new changes. Looking  
around I have read I should turn off the cache adding:

<property name="dispatcher.caching" value="off" />

to my forrest.properties.xml file. But the cache seems to be still  
working. As a test, I removed this part from my pelt- 
html.content.panel.xml file:
     <forrest:hook name="export-link">
       <forrest:contract name="content-pdf-link"/>
     </forrest:hook>

But the "export to pdf" icon does not disappears. I have to reboot  
forrest to obtain the desired result.

I am sure I'm missing something but I can imagine what.

Cheers,

Pablo

--
Pablo Barrera
http://gsyc.es/~barrera/


Re: Dispatcher cache deactivation not working

Posted by Pablo Barrera <ba...@gsyc.es>.
On 16/09/2008, at 12:38:13, Thorsten Scherler wrote:

> On Tue, 2008-09-16 at 12:30 +0100, Pablo Barrera wrote:
>> On 16/09/2008, at 12:21:09, Ross Gardler wrote:
>>
>>> Thorsten Scherler wrote:
>>>> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
>>>>> Hello
>>>>>
>>>>> I am trying to modify an structurer but every time I make a change
>>>>> I  have to reboot forrest, otherwise I don't see the new changes.
>>>>> Looking  around I have read I should turn off the cache adding:
>>>>>
>>>>> <property name="dispatcher.caching" value="off" />
>>>>>
>>>>> to my forrest.properties.xml file. But the cache seems to be
>>>>> still  working. As a test, I removed this part from my pelt-
>>>>> html.content.panel.xml file:
>>>>>    <forrest:hook name="export-link">
>>>>>      <forrest:contract name="content-pdf-link"/>
>>>>>    </forrest:hook>
>>>>>
>>>>> But the "export to pdf" icon does not disappears. I have to
>>>>> reboot  forrest to obtain the desired result.
>>>>>
>>>>> I am sure I'm missing something but I can imagine what.
>>>>>
>>>> Hmm, I experienced something similar but ATM I have no time to  
>>>> debug
>>>> it. Where is this structurer stored, in your project dir or in a
>>>> plugin?
>>>
>>> Please check your logs, search for "cache", they will tell you if
>>> the values returned are coming from the cache. If you don't find
>>> something like "returning... from cache" then it's not using the  
>>> cache
>>
>>
>>
>> The structurer is stored in my project, in the default location.
>>
>> I have checked logs/locationmap.log and I found this:
>>
>> DEBUG   (2008-09-16) 12:05.07:961   [core.modules.mapper.lm] (/
>> index.dispatcher.css): Locationmap cached location returned for hint:
>> resolve.panels.pelt-html.content value: PATH-TO-PROJECT/src/
>> documentation/resources//themes/pelt/panels/pelt- 
>> html.content.panel.xml
>
> the changes you are doing are in the structurer or in a panel?
>

Sorry if I wasn't clear. The file I am changing is  pelt- 
html.content.panel.xml, so the panel.

Pablo

--
Pablo Barrera
http://gsyc.es/~barrera/


Re: Dispatcher cache deactivation not working

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Tue, 2008-09-16 at 12:30 +0100, Pablo Barrera wrote:
> On 16/09/2008, at 12:21:09, Ross Gardler wrote:
> 
> > Thorsten Scherler wrote:
> >> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
> >>> Hello
> >>>
> >>> I am trying to modify an structurer but every time I make a change  
> >>> I  have to reboot forrest, otherwise I don't see the new changes.  
> >>> Looking  around I have read I should turn off the cache adding:
> >>>
> >>> <property name="dispatcher.caching" value="off" />
> >>>
> >>> to my forrest.properties.xml file. But the cache seems to be  
> >>> still  working. As a test, I removed this part from my pelt-  
> >>> html.content.panel.xml file:
> >>>     <forrest:hook name="export-link">
> >>>       <forrest:contract name="content-pdf-link"/>
> >>>     </forrest:hook>
> >>>
> >>> But the "export to pdf" icon does not disappears. I have to  
> >>> reboot  forrest to obtain the desired result.
> >>>
> >>> I am sure I'm missing something but I can imagine what.
> >>>
> >> Hmm, I experienced something similar but ATM I have no time to debug
> >> it. Where is this structurer stored, in your project dir or in a  
> >> plugin?
> >
> > Please check your logs, search for "cache", they will tell you if  
> > the values returned are coming from the cache. If you don't find  
> > something like "returning... from cache" then it's not using the cache
> 
> 
> 
> The structurer is stored in my project, in the default location.
> 
> I have checked logs/locationmap.log and I found this:
> 
> DEBUG   (2008-09-16) 12:05.07:961   [core.modules.mapper.lm] (/ 
> index.dispatcher.css): Locationmap cached location returned for hint:  
> resolve.panels.pelt-html.content value: PATH-TO-PROJECT/src/ 
> documentation/resources//themes/pelt/panels/pelt-html.content.panel.xml

the changes you are doing are in the structurer or in a panel?

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


RE: Dispatcher cache deactivation not working

Posted by Gavin <ga...@16degrees.com.au>.

> -----Original Message-----
> From: Pablo Barrera [mailto:barrera@gsyc.es]
> Sent: Tuesday, 16 September 2008 11:00 PM
> To: dev@forrest.apache.org
> Subject: Re: Dispatcher cache deactivation not working
> 
> 
<snip>
> >
> 
> A little bit more information. If I change a contract I can see the
> changes without rebooting forrest, but any change to pelt-
> html.content.panel.xml requires a reboot.

I've always had that scenario, never really gave it any more thought,
will be interesting to see if can be worked out, just thought I'd
mention that it is not unique to your setup.

Gav...

> 
> Pablo
> 
> --
> Pablo Barrera
> http://gsyc.es/~barrera/
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.6.21 - Release Date: 9/11/2008
> 12:00 AM


Re: Dispatcher cache deactivation not working

Posted by Pablo Barrera <ba...@gsyc.es>.
On 16/09/2008, at 13:52:29, Pablo Barrera wrote:

>
> On 16/09/2008, at 13:14:34, Ross Gardler wrote:
>
>> Pablo Barrera wrote:
>>> On 16/09/2008, at 12:21:09, Ross Gardler wrote:
>>>> Thorsten Scherler wrote:
>>>>> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
>>>>>> Hello
>>>>>>
>>>>>> I am trying to modify an structurer but every time I make a  
>>>>>> change I  have to reboot forrest, otherwise I don't see the new  
>>>>>> changes. Looking  around I have read I should turn off the  
>>>>>> cache adding:
>>>>>>
>>>>>> <property name="dispatcher.caching" value="off" />
>>
>> I'm not sure what this is supposed to do in the disaptcher, but it  
>> does not turn off the locationmap cache because:
>>
>>> DEBUG   (2008-09-16) 12:05.07:961   [core.modules.mapper.lm] (/ 
>>> index.dispatcher.css): Locationmap cached location returned for  
>>> hint: resolve.panels.pelt-html.content value: PATH-TO-PROJECT/src/ 
>>> documentation/resources//themes/pelt/panels/pelt- 
>>> html.content.panel.xml
>>
>> Try the "traditional" approach to turning off the LM caching.
>>
>> In main/webapp/WEB-INF/xconf/cocoon.xconf change the "cacheable"  
>> element for the LocationMapModule to false.
>>
>>   <!-- LocationMap is used to map one URL to another, allowing  
>> content to be stored anywhere -->
>>   <component-instance
>>     class="org.apache.forrest.locationmap.LocationMapModule"
>>     logger="core.modules.mapper.lm" name="lm">
>>     <file src="cocoon://locationmap.xml"/>
>>     <cacheable>false</cacheable>
>>     <cache-lifespan>100000</cache-lifespan>
>>   </component-instance>
>
>
>
> This is main/webapp/WEB-INF/cocoon.xconf in FORREST_HOME, isn't it?  
> I have change it to:
>
>    <!-- LocationMap is used to map one URL to another, allowing  
> content to be stored anywhere -->
>    <component-instance
>      class="org.apache.forrest.locationmap.LocationMapModule"
>      logger="core.modules.mapper.lm" name="lm">
>      <file src="cocoon://locationmap.xml"/>
>      <cacheable>false</cacheable>
>      <cache-lifespan>100000</cache-lifespan>
>    </component-instance>
>
> but same result. I have to reboot forrest to see the changes.
>

A little bit more information. If I change a contract I can see the  
changes without rebooting forrest, but any change to pelt- 
html.content.panel.xml requires a reboot.

Pablo

--
Pablo Barrera
http://gsyc.es/~barrera/


Re: Dispatcher cache deactivation not working

Posted by Pablo Barrera <ba...@gsyc.es>.
On 17/09/2008, at 8:53:07, Thorsten Scherler wrote:

> On Tue, 2008-09-16 at 14:32 +0100, Ross Gardler wrote:
>> Pablo Barrera wrote:
>>> ...
>> Then I can't help any further this is an issue with the dispathcer  
>> only.
>
> Not sure about it.
>
> Sadly I need to meet a deadline so I cannot debug as I want. However I
> did a quick session on my work project.
>
> The caching of the DispatcherTransformer is controlling the structure
> file. Pablo said that changing the structurer file will be reflected
> instantly. I can confirm this. Meaning is not the DT but another
> component.
>
> Panels get imported in the generator stage via jx. That raises the
> question whether jx generator has changed its behavior.
>
> In my work project I am using a custom structurer that does not  
> contain
> any jx cache key nor the cache-validity and I do not encounter the
> problem described.
>
> Try changing
> <forrest:views xmlns:forrest="http://apache.org/forrest/templates/1.0"
>  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
>  jx:cache-key="#{$cocoon/parameters/getRequest}"
> jx:cache-validity="$ 
> {Packages.org.apache.excalibur.source.impl.validity.NOPValidity()}">
>
> to
> <forrest:views xmlns:forrest="http://apache.org/forrest/templates/1.0"
>  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
>
> and if you done with the development turn on the caching again. I  
> reckon
> that will make all the difference.

Yes, right now the cache is off, so any change I made to the  pelt- 
html.content.panel.xml appears into the page without rebooting forrest.

> IMO it is the jx generator that does not test the validate of the
> <jx:import/> it is processing. You may want to use a other validity  
> then
> the NOPValidity() since this seems to be the root of the problem you
> describe. The jx documentation will give you some hints (if not search
> in the cocoon dev ml for "jx caching").
>
> Hope that helps and would be nice if it makes it into the  
> documentation.



Where? I am still a little bit lost with the documentation. Maybe just  
a note in dispatcher quickstart should be enough.

Thanks,

Pablo

--
Pablo Barrera
http://gsyc.es/~barrera/


Re: Dispatcher cache deactivation not working

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Tue, 2008-09-16 at 14:32 +0100, Ross Gardler wrote:
> Pablo Barrera wrote:
> > ...
> Then I can't help any further this is an issue with the dispathcer only. 

Not sure about it. 

Sadly I need to meet a deadline so I cannot debug as I want. However I
did a quick session on my work project.

The caching of the DispatcherTransformer is controlling the structure
file. Pablo said that changing the structurer file will be reflected
instantly. I can confirm this. Meaning is not the DT but another
component.

Panels get imported in the generator stage via jx. That raises the
question whether jx generator has changed its behavior. 

In my work project I am using a custom structurer that does not contain
any jx cache key nor the cache-validity and I do not encounter the
problem described. 

Try changing 
<forrest:views xmlns:forrest="http://apache.org/forrest/templates/1.0" 
  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
  jx:cache-key="#{$cocoon/parameters/getRequest}"
jx:cache-validity="${Packages.org.apache.excalibur.source.impl.validity.NOPValidity()}">

to 
<forrest:views xmlns:forrest="http://apache.org/forrest/templates/1.0" 
  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">

and if you done with the development turn on the caching again. I reckon
that will make all the difference. 

IMO it is the jx generator that does not test the validate of the
<jx:import/> it is processing. You may want to use a other validity then
the NOPValidity() since this seems to be the root of the problem you
describe. The jx documentation will give you some hints (if not search
in the cocoon dev ml for "jx caching").

Hope that helps and would be nice if it makes it into the documentation.

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Re: Dispatcher cache deactivation not working

Posted by Ross Gardler <rg...@apache.org>.
Pablo Barrera wrote:
> 
> On 16/09/2008, at 13:14:34, Ross Gardler wrote:
> 
>> Pablo Barrera wrote:
>>> On 16/09/2008, at 12:21:09, Ross Gardler wrote:
>>>> Thorsten Scherler wrote:
>>>>> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
>>>>>> Hello
>>>>>>
>>>>>> I am trying to modify an structurer but every time I make a change 
>>>>>> I  have to reboot forrest, otherwise I don't see the new changes. 
>>>>>> Looking  around I have read I should turn off the cache adding:
>>>>>>
>>>>>> <property name="dispatcher.caching" value="off" />
>>
>> I'm not sure what this is supposed to do in the disaptcher, but it 
>> does not turn off the locationmap cache because:
>>
>>> DEBUG   (2008-09-16) 12:05.07:961   [core.modules.mapper.lm] 
>>> (/index.dispatcher.css): Locationmap cached location returned for 
>>> hint: resolve.panels.pelt-html.content value: 
>>> PATH-TO-PROJECT/src/documentation/resources//themes/pelt/panels/pelt-html.content.panel.xml 
>>>
>>
>> Try the "traditional" approach to turning off the LM caching.
>>
>> In main/webapp/WEB-INF/xconf/cocoon.xconf change the "cacheable" 
>> element for the LocationMapModule to false.
>>
>>    <!-- LocationMap is used to map one URL to another, allowing 
>> content to be stored anywhere -->
>>    <component-instance
>>      class="org.apache.forrest.locationmap.LocationMapModule"
>>      logger="core.modules.mapper.lm" name="lm">
>>      <file src="cocoon://locationmap.xml"/>
>>      <cacheable>false</cacheable>
>>      <cache-lifespan>100000</cache-lifespan>
>>    </component-instance>
> 
> 
> 
> This is main/webapp/WEB-INF/cocoon.xconf in FORREST_HOME, isn't it? I 
> have change it to:
> 
>     <!-- LocationMap is used to map one URL to another, allowing content 
> to be stored anywhere -->
>     <component-instance
>       class="org.apache.forrest.locationmap.LocationMapModule"
>       logger="core.modules.mapper.lm" name="lm">
>       <file src="cocoon://locationmap.xml"/>
>       <cacheable>false</cacheable>
>       <cache-lifespan>100000</cache-lifespan>
>     </component-instance>
> 
> but same result. I have to reboot forrest to see the changes.

Then I can't help any further this is an issue with the dispathcer only. 
LM caching works elsewhere (to the best of my knowledge0.

Ross

Re: Dispatcher cache deactivation not working

Posted by Pablo Barrera <ba...@gsyc.es>.
On 16/09/2008, at 13:14:34, Ross Gardler wrote:

> Pablo Barrera wrote:
>> On 16/09/2008, at 12:21:09, Ross Gardler wrote:
>>> Thorsten Scherler wrote:
>>>> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
>>>>> Hello
>>>>>
>>>>> I am trying to modify an structurer but every time I make a  
>>>>> change I  have to reboot forrest, otherwise I don't see the new  
>>>>> changes. Looking  around I have read I should turn off the cache  
>>>>> adding:
>>>>>
>>>>> <property name="dispatcher.caching" value="off" />
>
> I'm not sure what this is supposed to do in the disaptcher, but it  
> does not turn off the locationmap cache because:
>
>> DEBUG   (2008-09-16) 12:05.07:961   [core.modules.mapper.lm] (/ 
>> index.dispatcher.css): Locationmap cached location returned for  
>> hint: resolve.panels.pelt-html.content value: PATH-TO-PROJECT/src/ 
>> documentation/resources//themes/pelt/panels/pelt- 
>> html.content.panel.xml
>
> Try the "traditional" approach to turning off the LM caching.
>
> In main/webapp/WEB-INF/xconf/cocoon.xconf change the "cacheable"  
> element for the LocationMapModule to false.
>
>    <!-- LocationMap is used to map one URL to another, allowing  
> content to be stored anywhere -->
>    <component-instance
>      class="org.apache.forrest.locationmap.LocationMapModule"
>      logger="core.modules.mapper.lm" name="lm">
>      <file src="cocoon://locationmap.xml"/>
>      <cacheable>false</cacheable>
>      <cache-lifespan>100000</cache-lifespan>
>    </component-instance>



This is main/webapp/WEB-INF/cocoon.xconf in FORREST_HOME, isn't it? I  
have change it to:

     <!-- LocationMap is used to map one URL to another, allowing  
content to be stored anywhere -->
     <component-instance
       class="org.apache.forrest.locationmap.LocationMapModule"
       logger="core.modules.mapper.lm" name="lm">
       <file src="cocoon://locationmap.xml"/>
       <cacheable>false</cacheable>
       <cache-lifespan>100000</cache-lifespan>
     </component-instance>

but same result. I have to reboot forrest to see the changes.

Cheers,

Pablo



--
Pablo Barrera
http://gsyc.es/~barrera/


Re: Dispatcher cache deactivation not working

Posted by Ross Gardler <rg...@apache.org>.
Pablo Barrera wrote:
> 
> On 16/09/2008, at 12:21:09, Ross Gardler wrote:
> 
>> Thorsten Scherler wrote:
>>> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
>>>> Hello
>>>>
>>>> I am trying to modify an structurer but every time I make a change 
>>>> I  have to reboot forrest, otherwise I don't see the new changes. 
>>>> Looking  around I have read I should turn off the cache adding:
>>>>
>>>> <property name="dispatcher.caching" value="off" />

I'm not sure what this is supposed to do in the disaptcher, but it does 
not turn off the locationmap cache because:

> DEBUG   (2008-09-16) 12:05.07:961   [core.modules.mapper.lm] 
> (/index.dispatcher.css): Locationmap cached location returned for hint: 
> resolve.panels.pelt-html.content value: 
> PATH-TO-PROJECT/src/documentation/resources//themes/pelt/panels/pelt-html.content.panel.xml 

Try the "traditional" approach to turning off the LM caching.

In main/webapp/WEB-INF/xconf/cocoon.xconf change the "cacheable" element 
for the LocationMapModule to false.

     <!-- LocationMap is used to map one URL to another, allowing 
content to be stored anywhere -->
     <component-instance
       class="org.apache.forrest.locationmap.LocationMapModule"
       logger="core.modules.mapper.lm" name="lm">
       <file src="cocoon://locationmap.xml"/>
       <cacheable>false</cacheable>
       <cache-lifespan>100000</cache-lifespan>
     </component-instance>

Ross



Re: Dispatcher cache deactivation not working

Posted by Pablo Barrera <ba...@gsyc.es>.
On 16/09/2008, at 12:21:09, Ross Gardler wrote:

> Thorsten Scherler wrote:
>> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
>>> Hello
>>>
>>> I am trying to modify an structurer but every time I make a change  
>>> I  have to reboot forrest, otherwise I don't see the new changes.  
>>> Looking  around I have read I should turn off the cache adding:
>>>
>>> <property name="dispatcher.caching" value="off" />
>>>
>>> to my forrest.properties.xml file. But the cache seems to be  
>>> still  working. As a test, I removed this part from my pelt-  
>>> html.content.panel.xml file:
>>>     <forrest:hook name="export-link">
>>>       <forrest:contract name="content-pdf-link"/>
>>>     </forrest:hook>
>>>
>>> But the "export to pdf" icon does not disappears. I have to  
>>> reboot  forrest to obtain the desired result.
>>>
>>> I am sure I'm missing something but I can imagine what.
>>>
>> Hmm, I experienced something similar but ATM I have no time to debug
>> it. Where is this structurer stored, in your project dir or in a  
>> plugin?
>
> Please check your logs, search for "cache", they will tell you if  
> the values returned are coming from the cache. If you don't find  
> something like "returning... from cache" then it's not using the cache



The structurer is stored in my project, in the default location.

I have checked logs/locationmap.log and I found this:

DEBUG   (2008-09-16) 12:05.07:961   [core.modules.mapper.lm] (/ 
index.dispatcher.css): Locationmap cached location returned for hint:  
resolve.panels.pelt-html.content value: PATH-TO-PROJECT/src/ 
documentation/resources//themes/pelt/panels/pelt-html.content.panel.xml

Pablo

--
Pablo Barrera
http://gsyc.es/~barrera/


Re: Dispatcher cache deactivation not working

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
>> Hello
>>
>> I am trying to modify an structurer but every time I make a change I  
>> have to reboot forrest, otherwise I don't see the new changes. Looking  
>> around I have read I should turn off the cache adding:
>>
>> <property name="dispatcher.caching" value="off" />
>>
>> to my forrest.properties.xml file. But the cache seems to be still  
>> working. As a test, I removed this part from my pelt- 
>> html.content.panel.xml file:
>>      <forrest:hook name="export-link">
>>        <forrest:contract name="content-pdf-link"/>
>>      </forrest:hook>
>>
>> But the "export to pdf" icon does not disappears. I have to reboot  
>> forrest to obtain the desired result.
>>
>> I am sure I'm missing something but I can imagine what.
>>
> 
> Hmm, I experienced something similar but ATM I have no time to debug
> it. 
> 
> Where is this structurer stored, in your project dir or in a plugin?

Please check your logs, search for "cache", they will tell you if the 
values returned are coming from the cache. If you don't find something 
like "returning... from cache" then it's not using the cache

Ross

Re: Dispatcher cache deactivation not working

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Tue, 2008-09-16 at 11:22 +0100, Pablo Barrera wrote:
> Hello
> 
> I am trying to modify an structurer but every time I make a change I  
> have to reboot forrest, otherwise I don't see the new changes. Looking  
> around I have read I should turn off the cache adding:
> 
> <property name="dispatcher.caching" value="off" />
> 
> to my forrest.properties.xml file. But the cache seems to be still  
> working. As a test, I removed this part from my pelt- 
> html.content.panel.xml file:
>      <forrest:hook name="export-link">
>        <forrest:contract name="content-pdf-link"/>
>      </forrest:hook>
> 
> But the "export to pdf" icon does not disappears. I have to reboot  
> forrest to obtain the desired result.
> 
> I am sure I'm missing something but I can imagine what.
> 

Hmm, I experienced something similar but ATM I have no time to debug
it. 

Where is this structurer stored, in your project dir or in a plugin?

salu2

> Cheers,
> 
> Pablo
> 
> --
> Pablo Barrera
> http://gsyc.es/~barrera/
> 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions