Re: Update probleme with component instance and XMLFileModule package

<[email protected]>
Newsgroups gmane.text.xml.cocoon.user
Message-ID <b472daa0ebf9b513a028645e905005dc@localhost>
On Sat, 17 Nov 2012 23:00:34 +0100, Thorsten Scherler
<[email protected]> wrote:
> On 11/15/2012 11:45 AM, DIA Modou wrote:
>> hi,
>>
>> I'm working with coocon 2.1 and tomcat 6.0.32.
>>
>> I have a code which permit to use an xml file as a global variable. I
>> build that with a "component instance" and the package
>> "org.apache.cocoon.components.modules.input.XMLFileModule" like this:
>>
>>
>> <component-instance
>>   class="org.apache.cocoon.components.modules.input.XMLFileModule"
>>   logger="core.modules.input"
>>   name="userinfos-xml">
>>
>>   <file
>>     src="cocoon://auth/userinfos.xml"
>>     reloadable="true"
>>     cacheable="true"
>>     cache-expressions="false" />
>>
>> </component-instance>
>>
>>
>>
>> In my "pipelines", i use "userinfos-xml" like this:
>>
>>
>> <map:match type="regexp" pattern="something.html">
>>   <map:generate type="xsp" src="something.xsp">
>>     <map:parameter
>>       name="role"
>>       value="{userinfos-xml:/userinfos/authentication/roles}" />
>>   </map:generate>
>>   ...
>> </map:match>
>>
>>
>> When a user is logged the function "cocoon://auth/userinfos.xml" return
>> his informations of session ("id", "groups", ...) as an xml file. If
>> user isn't logged, the result is an empty xml file.
>>
>> My problem is after some hours (~ 8hours) without restarting the
>> "tomcat" server, the variable "userinfos-xml" is empty even if the user
>> is logged.
>>
>> I tried to remove the cache with this configuration:
>>
>>
>>   <file
>>     src="cocoon://auth/userinfos.xml"
>>     reloadable="false"
>>     cacheable="false"
>>     cache-expressions="false" />
>>
>>
>> but, the problem is always persistant. I think that the component
>> instance isn't updated anymore after some hours
>>
>>
>> thanks for your helps.
> 
> Hmm, that sounds like a session timeout.
> 
> You can validate to set a really short session timeout on your app and
> on tomcat and see if the problem occur after the session expires.
I manage the session timeout on web.xml
(session-config/session-timeout) with a duration of 2mn, all work nice
after a dozen of minutes. I'll tell you if I encounter the same problem
after some hours.
In tomcat except for the "connectionTimeout" in the server.xml file, i
don't know how to configure the duration of an session.
> 
> The question is how you create the cocoon://auth/userinfos.xml file:
> - business logic: do you connect to servlet session to get the user data
> - whether you set some caching in the pipe so it happens to expire after
> 8 hours
> - ...
The function "cocoon://auth/userinfos.xml" serve via a xsp the contain
of a session variable. That session variable is builded and managed as a
DOM structures with the package "org.apache.cocoon.auth".
I think that the cause of my problem is independant with that function
because when usersinfo-xml is empty, the function usersinfo.xml is still
served correctly.
> 
> salu2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.