You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Florent André <fl...@4sengines.com> on 2009/03/21 13:03:21 UTC

Re: Job Scheduler in Lenya/Cocoon

Hi Anish,

I think I have the same problem you solve : 

org.apache.excalibur.source.SourceException: Cannot get input stream for
cocoon://modules/mymodule/crontest

In the component test <pipeline> I try
* modules/mymodule/crontest
* lenya/modules/mymodule/crontest
* mymodule/crontest

... but nothing work.

Can you help me ?

--- cocoon.conf ---
## cron component/trigger :
 <triggers>
        <trigger name="test-job1"
                 target="org.apache.cocoon.components.cron.CronJob/test"
                 concurrent-runs="false">
          <cron>*/2 * * * * ? *</cron>
        </trigger>
      </triggers>

##component test :
 <component role="org.apache.cocoon.components.cron.CronJob/test"
             class="org.apache.cocoon.components.cron.TestCronJob"
             logger="cron.test">
<!--    <msg>I'm here</msg>
    <sleep>23000</sleep>-->
    <pipeline>modules/mymodule/crontest</pipeline>
  </component>



--- Mymodule.xmap ---
      <map:match pattern="**/crontest/**">

        <map:generate src="test/source.xml"/>

        <!-- DEV DEBUG 1 BEGIN -->
        <map:call resource="log-to-file">
          <map:parameter name="fileprefix" value="CronCall"/>
        </map:call>
        <!-- DEV DEBUG 1 END -->

        <map:serialize type="xml"/>
      </map:match>

TIA & HAND


On Tue, 20 Jan 2009 17:25:50 +0530, Anish <an...@techblue.co.uk>
wrote:
> Anish wrote:
>> Hi
>>
>> I've applied cron scheduler to my Cocoon/Lenya Application. I'm trying 
>> to call a pipeline (which is  publication specific i.e. inside 
>> publication-sitemap.xmap).
>>
>> My call from scheduler reaches to the sitemap but during processing it 
>> throws :
>>
>> org.apache.excalibur.source.SourceException: Cannot get input stream 
>> for cocoon://mypublication/live/mypage.xml
>>
>> due to:
>>
>> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>>
>> Although my all pipelines work fine inside the publication as I access 
>> through browser.
>>
>> I'm using:
>>
>> Cocoon 2.1.7
>> Lenya 1.2.4
>> Tomcat 5.5.17
>>
>> Please suggest.
>>
>> Vik Tara wrote:
>>>>> for general scheduling tasks, take a look at the cron block API
>>>>> documentation in Cocoon.
>>>>>       
>>>
>>> I think that's here:
>>> http://xmlshoestring.com/samples/blocks/cron/samples
>>>
>>> Andreas Hartmann wrote:
>>>   
>>>> Hi Anish,
>>>>
>>>> Anish schrieb:
>>>>     
>>>>> I was trying to implement Cocoon Job Scheduler. Please help and
>>>>> provide me documentation/information as I could hardly find relevant
>>>>> documentation on that.
>>>>>       
>>>> for general scheduling tasks, take a look at the cron block API
>>>> documentation in Cocoon.
>>>>
>>>> For an example how to schedule a Lenya usecase, consult the API of the
>>>> UsecaseScheduler class and use the Publish usecase as an example.
>>>>
>>>> -- Andreas
>>>>
>>>>
>>>>     
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>
>>>   
>>
>>
>> -- 
>> Thanks & Regards,
>> Anish
> Hi All
> 
> Thanks, The issue is resolved.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Job Scheduler in Lenya/Cocoon

Posted by Florent André <fl...@4sengines.com>.
Hi,

I make a "up !", because I really have to create a cron that call a
pipeline and I try many thinks with no result...

What is your solution Anish ? pleeeeze :)

++

On Sat, 21 Mar 2009 13:03:21 +0100, Florent André
<fl...@4sengines.com> wrote:
> Hi Anish,
> 
> I think I have the same problem you solve : 
> 
> org.apache.excalibur.source.SourceException: Cannot get input stream for
> cocoon://modules/mymodule/crontest
> 
> In the component test <pipeline> I try
> * modules/mymodule/crontest
> * lenya/modules/mymodule/crontest
> * mymodule/crontest
> 
> ... but nothing work.
> 
> Can you help me ?
> 
> --- cocoon.conf ---
> ## cron component/trigger :
>  <triggers>
>         <trigger name="test-job1"
>                  target="org.apache.cocoon.components.cron.CronJob/test"
>                  concurrent-runs="false">
>           <cron>*/2 * * * * ? *</cron>
>         </trigger>
>       </triggers>
> 
> ##component test :
>  <component role="org.apache.cocoon.components.cron.CronJob/test"
>              class="org.apache.cocoon.components.cron.TestCronJob"
>              logger="cron.test">
> <!--    <msg>I'm here</msg>
>     <sleep>23000</sleep>-->
>     <pipeline>modules/mymodule/crontest</pipeline>
>   </component>
> 
> 
> 
> --- Mymodule.xmap ---
>       <map:match pattern="**/crontest/**">
> 
>         <map:generate src="test/source.xml"/>
> 
>         <!-- DEV DEBUG 1 BEGIN -->
>         <map:call resource="log-to-file">
>           <map:parameter name="fileprefix" value="CronCall"/>
>         </map:call>
>         <!-- DEV DEBUG 1 END -->
> 
>         <map:serialize type="xml"/>
>       </map:match>
> 
> TIA & HAND
> 
> 
> On Tue, 20 Jan 2009 17:25:50 +0530, Anish <an...@techblue.co.uk>
> wrote:
>> Anish wrote:
>>> Hi
>>>
>>> I've applied cron scheduler to my Cocoon/Lenya Application. I'm trying 
>>> to call a pipeline (which is  publication specific i.e. inside 
>>> publication-sitemap.xmap).
>>>
>>> My call from scheduler reaches to the sitemap but during processing it 
>>> throws :
>>>
>>> org.apache.excalibur.source.SourceException: Cannot get input stream 
>>> for cocoon://mypublication/live/mypage.xml
>>>
>>> due to:
>>>
>>> java.lang.StringIndexOutOfBoundsException: String index out of range:
-1
>>>
>>> Although my all pipelines work fine inside the publication as I access 
>>> through browser.
>>>
>>> I'm using:
>>>
>>> Cocoon 2.1.7
>>> Lenya 1.2.4
>>> Tomcat 5.5.17
>>>
>>> Please suggest.
>>>
>>> Vik Tara wrote:
>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>> documentation in Cocoon.
>>>>>>       
>>>>
>>>> I think that's here:
>>>> http://xmlshoestring.com/samples/blocks/cron/samples
>>>>
>>>> Andreas Hartmann wrote:
>>>>   
>>>>> Hi Anish,
>>>>>
>>>>> Anish schrieb:
>>>>>     
>>>>>> I was trying to implement Cocoon Job Scheduler. Please help and
>>>>>> provide me documentation/information as I could hardly find relevant
>>>>>> documentation on that.
>>>>>>       
>>>>> for general scheduling tasks, take a look at the cron block API
>>>>> documentation in Cocoon.
>>>>>
>>>>> For an example how to schedule a Lenya usecase, consult the API of
the
>>>>> UsecaseScheduler class and use the Publish usecase as an example.
>>>>>
>>>>> -- Andreas
>>>>>
>>>>>
>>>>>     
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>>
>>>>   
>>>
>>>
>>> -- 
>>> Thanks & Regards,
>>> Anish
>> Hi All
>> 
>> Thanks, The issue is resolved.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: [ModuleStatus] First idea (was Re: Spring cleaning: Remove unmaintained modules?)

Posted by Andreas Hartmann <an...@apache.org>.
Florent André schrieb:
>>> === Patch to Module.xml ===
>>>
>>> * The idea is to add some tags in order to have "dev status" of each
>>> module.
>>> <module xmlns="http://apache.org/lenya/module/1.0">
>>> <moduleinformations>
>>>   <objectives> describe why do this module </objective>
>>>   <longdescription> description that is show to end
>>>   user</longdescription>
>>>   <curentstate> dev / usable with care / stable / ... </curentstate>
>>> </moduleinformations
>>> <technicalinformations>
>> I wouldn't require to change the structure of existing elements 
>> (backwards compatibility).
> 
> So, what is the best way ?
> - not add the "technicalinformations" section and just add other sections ?

I think this would be the best option – don't change the existing 
structure, only add new sections. WDOT?

> - create a specific file with this informations ?

Maybe we should use separate files for the module documentation (e.g., 
$MODULE_HOME/docs/*.xml) to avoid overloading the module.xml.

>>>   <id>org.apache.lenya.modules.ac</id>
>>>   <export package="..."/>
>>>   <depends module="..."/>
>>>   <package>org.apache.lenya.modules</package>
>>>   <version>0.1-dev</version>
>>>   <name>Access control</name>
>>>   <lenya-version>@lenya.version@</lenya-version>
>>>   <description>Access control</description>
>>> </technicalinformations>
>>> <statusinformations>
>>>   <curentversion>
>>>     <developers>
>>>       <person name=".." email="..." id="DB"/>
>>>     </developers>
>>>     <problems> (or warning?)
>>>       <problem priority=".."> knowing problems </problem>
>>>     <problems>
>>>     <changes>
>>>       <release version="2.1.12" date="..">
>>>         <action dev="all" type="update">
>>>       </release>
>>>     </change>
>>>     <howtoinstall> installation instructions if any </howtoinstall>
>>>     <howtouse> how to use module's functions or module's interface
>>> </howtouse>
>>>   </curentversion>
>> The "future versions" section can IMO be omitted, we have bugzilla for 
>> this purpose.
> 
> In my mind, bugzilla is more for "coding problems", here "future versions"
> is more a end-user function description.

IMO Bugzilla is equally suitable for end-user requirements, e.g. 
enhancement requests.

> 
>>>   <futureversion>
> [...]
>>>   <futureversion>
>>> </module>
>>>
>>> Some of this tags are inspired by the cocoon file :
>>> apache-lenya-2.0.2-src/externals/cocoon_2_1_x/status.xml
>> Maybe the Maven POM would be another alternative?
>>
>> http://maven.apache.org/pom.html#More_Project_Information
>>
>> I really hope we'll move to Maven someday, this might simplify the 
>> migration.
> 
> Yes this xsd seems to me very cool ! But, IMO this is a developer centric
> view, I don't see information with end-user view.

OK, this is a good point. I'd suggest to include only 
development-related info in module.xml and use a separate directory for 
the user documentation (see above).

-- Andreas

> My fist idea is to have an easy-filling file for dev that can be set in
> visibility on the Lenya website with an automatic svn borwsing of this
> file.
> This user visibility is an important piece for a larger use of Lenya.
> 
> 
>>> Maybe this proposal is a little bit complicated, but I think that this
>>> informations will be useful for potential co-dev and for (end-)user  :
>>> see
>>> what is the module spirits, his status and his future capabilities.
>> Is it realistic to assume that this information will be added? Well, I 
>> guess we'll see :)
> 
> I hope too ! :) IMO if the system is simple and increase the use of modules
> and community size, this information will be fill in.
> 
>> […]
>>
>>> === SVN browsing ===
>>>
>>> Andreas : "ATM the code to update the SVN changes is in the forrest
>>> module,
>>> which is rather confusing. I think we should create a new module for
> this
>>> purpose."
>>> ==> @andreas : Do you have a pointer (class or pipeline name) to the
> code
>>> in the forrest module ?
>> Sure, this is the usecase which updates the changes:
>>
>>
> http://svn.apache.org/viewvc/lenya/docu/modules/forrest/java/src/org/apache/lenya/modules/forrest/UpdateChanges.java?view=log
> 
> Thanks ! This is a good starting point.
> 
>> -- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


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


Re: [ModuleStatus] First idea (was Re: Spring cleaning: Remove unmaintainedmodules?)

Posted by Florent André <fl...@4sengines.com>.
Thanks for your feedback Andreas !


On Mon, 23 Mar 2009 11:03:05 +0100, Andreas Hartmann <an...@apache.org>
wrote:
> Florent André schrieb:
> 
> […]
> 
>> === Patch to Module.xml ===
>> 
>> * The idea is to add some tags in order to have "dev status" of each
>> module.
>> <module xmlns="http://apache.org/lenya/module/1.0">
>> <moduleinformations>
>>   <objectives> describe why do this module </objective>
>>   <longdescription> description that is show to end
>>   user</longdescription>
>>   <curentstate> dev / usable with care / stable / ... </curentstate>
>> </moduleinformations
>> <technicalinformations>
> 
> I wouldn't require to change the structure of existing elements 
> (backwards compatibility).

So, what is the best way ?
- not add the "technicalinformations" section and just add other sections ?
- create a specific file with this informations ? 

> 
>>   <id>org.apache.lenya.modules.ac</id>
>>   <export package="..."/>
>>   <depends module="..."/>
>>   <package>org.apache.lenya.modules</package>
>>   <version>0.1-dev</version>
>>   <name>Access control</name>
>>   <lenya-version>@lenya.version@</lenya-version>
>>   <description>Access control</description>
>> </technicalinformations>
>> <statusinformations>
>>   <curentversion>
>>     <developers>
>>       <person name=".." email="..." id="DB"/>
>>     </developers>
>>     <problems> (or warning?)
>>       <problem priority=".."> knowing problems </problem>
>>     <problems>
>>     <changes>
>>       <release version="2.1.12" date="..">
>>         <action dev="all" type="update">
>>       </release>
>>     </change>
>>     <howtoinstall> installation instructions if any </howtoinstall>
>>     <howtouse> how to use module's functions or module's interface
>> </howtouse>
>>   </curentversion>
> 
> The "future versions" section can IMO be omitted, we have bugzilla for 
> this purpose.

In my mind, bugzilla is more for "coding problems", here "future versions"
is more a end-user function description.

> 
>>   <futureversion>
[...]
>>   <futureversion>
>> </module>
>> 
>> Some of this tags are inspired by the cocoon file :
>> apache-lenya-2.0.2-src/externals/cocoon_2_1_x/status.xml
> 
> Maybe the Maven POM would be another alternative?
> 
> http://maven.apache.org/pom.html#More_Project_Information
> 
> I really hope we'll move to Maven someday, this might simplify the 
> migration.

Yes this xsd seems to me very cool ! But, IMO this is a developer centric
view, I don't see information with end-user view. 

My fist idea is to have an easy-filling file for dev that can be set in
visibility on the Lenya website with an automatic svn borwsing of this
file.
This user visibility is an important piece for a larger use of Lenya.


> 
>> Maybe this proposal is a little bit complicated, but I think that this
>> informations will be useful for potential co-dev and for (end-)user  :
>> see
>> what is the module spirits, his status and his future capabilities.
> 
> Is it realistic to assume that this information will be added? Well, I 
> guess we'll see :)

I hope too ! :) IMO if the system is simple and increase the use of modules
and community size, this information will be fill in.

> 
> […]
> 
>> === SVN browsing ===
>> 
>> Andreas : "ATM the code to update the SVN changes is in the forrest
>> module,
>> which is rather confusing. I think we should create a new module for
this
>> purpose."
>> ==> @andreas : Do you have a pointer (class or pipeline name) to the
code
>> in the forrest module ?
> 
> Sure, this is the usecase which updates the changes:
> 
>
http://svn.apache.org/viewvc/lenya/docu/modules/forrest/java/src/org/apache/lenya/modules/forrest/UpdateChanges.java?view=log

Thanks ! This is a good starting point.

> 
> -- Andreas

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


Re: Job Scheduler in Lenya/Cocoon

Posted by Florent André <fl...@4sengines.com>.
Hi all,

The return of cron bug ! :) (resume of lasts episodes : the cron job in
cocoon.xconf don't work on Lenya 2.0)

As Anish said : "it's work for me on Lenya on Lenya 1.2.4",
-- I do a diff on the org.apache.cocoon.components.cron.CronJob of 1.2 and
2.0 : there is some diff.
-- so I get the 1.2 CronJob.java, compile it as
CronJobOld.java, try it in the cocoon.xconf cron definition... and it's
don't work...
-- So the idea of a problem in the global-sitemap.xmap seems to be good...

BUT : as Andreas suggests, fire the pipeline throw browser work
- so, I edit my linux crontab with this line : 0 9 * * mon wget -O
/dev/null http://tomcat.serveur/lenya/dev/modules/mymodules/mypipeline
- and it don't work
- I open a fresh lovely firefox on the pipe... and it don't work !
- I open a new tab and CONNECT to Lenya, I refresh my pipe's tab : and it
work !

IN FACT :
- the call of this pipeline works when we are CONNECTED to lenya
- the cocoon.xconf, and a unconnected browser can't fire the pipeline !

QUESTIONS :
- Anish, can you redo this "way of work" ? (pipeline fire when connected,
but not when not connected)
- In my case, the module's resource is on authoring (have to be connect)...
but I fire a pipeline that have no deal with this resource. I think that
there is no relationship between the publication status of the resource and
the possibility of fire a pipeline. I'm right ?
- This possible to define a pipeline that we can call without have to be
connected ? 
- In a more general way, what is the relationship between pipeline and
connexion ?

Thanks !
Have a good day

On Tue, 24 Mar 2009 16:50:24 +0100, Florent André
<fl...@4sengines.com> wrote:
> arrrghh !  :)
> 
> Thanks for your answer Anish.
> 
> On Tue, 24 Mar 2009 14:24:22 +0530, Anish <an...@techblue.co.uk>
> wrote:
>> Hi Florent
>> 
>>> The URI prefix is removed when the module sitemap is mounted. And the 
>>> pipeline in the above configuration ends with "crontest". So I guess 
>>> this should read
>>>
>>>        <map:match pattern="crontest">
>> Even I tried the same way, Andreas suggested.
>> 
>> It's not working for Lenya 2.0 (as I'm calling a module's internal 
>> pipeline). Although pipeline worked fine if called though browser (on 
>> http://)
> 
> Me too. I also call this pipeline with a <map:generate
> src="cocoon://modules/mymodule/crontest"> and it's work... (the
> map:generate and the map:match pattern="crontest" are in the same
sitemap).
> 
>> 
>> Earlier I had applied this scheduler for Cocoon 2.1.7/Lenya 1.2.4 
>> (without modules) and there it worked.
>> (in that case I called  
>>  <pipeline>mypublication/live/mycron.xml</pipeline>, this pipeline 
>> resides in my publication-sitemap.xmap)
> 
> I don't have lenya 1.2.4, so do you know if the difference is : 
> - between the cocoon java cron class (I try with
> cocoon.components.cron.TestCronJob and
> cocoon.components.cron.CocoonPipelineCronJob : nothing work)
> - between the lenya's sitemap ?
> 
> 
>> 
>> I think in the case of Lenya 2.0, module's sitemap is not getting 
>> mounted properly.
>> 
>> I'm trying to resolve this.
> 
> Also... because the log have the error : <map:mount> -
> file:///var/lib/tomcat5.5/./webapps/lenya/sitemap.xmap:661:106
> 
> I try on the sitemap : 
> ------------------------------------------------------------------
> 1 - to remplace  : map:mount by map:read (I see an example on the web
with
> read) in :
>  <map:match pattern="**">
>         <map:mount check-reload="true" reload-method="synchron"
> src="global-sitemap.xmap" uri-prefix=""/>
>       </map:match>
> (the match pointed by log)
> ------------------------------------------------------------------
> 2 - to add :
> **** in webapps/lenya/sitemap.xmap 
> <map:match pattern="cron/modules/*/**">
>         <map:mount uri-prefix="modules/{1}/"
> src="{fallback:lenya/modules/{1}/sitemap.xmap}" check-reload="true"
> reload-method="synchron"/>
> </map:match>
> **** in my cocoon.xconf cron's pipeline definition : 
>  <pipeline>cron/modules/killbookmakers/crontest</pipeline>
> 
> (I'm not really sure with my sitemap.xmap's map:mount definition...)
> 
> And nothing work... :(
> 
> 
> Open to all suggestions...
> 
> ++
> 
> 
> 
>> 
>> 
>> 
>> 
>> Andreas Hartmann wrote:
>>> Florent André schrieb:
>>>> Hi Anish,
>>>>
>>>> I think I have the same problem you solve :
>>>> org.apache.excalibur.source.SourceException: Cannot get input stream
> for
>>>> cocoon://modules/mymodule/crontest
>>>>
>>>> In the component test <pipeline> I try
>>>> * modules/mymodule/crontest
>>>> * lenya/modules/mymodule/crontest
>>>> * mymodule/crontest
>>>>
>>>> ... but nothing work.
>>>>
>>>> Can you help me ?
>>>>
>>>> --- cocoon.conf ---
>>>> ## cron component/trigger :
>>>>  <triggers>
>>>>         <trigger name="test-job1"
>>>>                 
> target="org.apache.cocoon.components.cron.CronJob/test"
>>>>                  concurrent-runs="false">
>>>>           <cron>*/2 * * * * ? *</cron>
>>>>         </trigger>
>>>>       </triggers>
>>>>
>>>> ##component test :
>>>>  <component role="org.apache.cocoon.components.cron.CronJob/test"
>>>>              class="org.apache.cocoon.components.cron.TestCronJob"
>>>>              logger="cron.test">
>>>> <!--    <msg>I'm here</msg>
>>>>     <sleep>23000</sleep>-->
>>>>     <pipeline>modules/mymodule/crontest</pipeline>
>>>>   </component>
>>>>
>>>>
>>>>
>>>> --- Mymodule.xmap ---
>>>>       <map:match pattern="**/crontest/**">
>>>
>>> The URI prefix is removed when the module sitemap is mounted. And the 
>>> pipeline in the above configuration ends with "crontest". So I guess 
>>> this should read
>>>
>>>        <map:match pattern="crontest">
>>>
>>> Does it work when you call the URI from the browser instead of the 
>>> cron job?
>>>
>>> Maybe this helps,
>>>
>>> -- Andreas
>>>
>>>>
>>>>         <map:generate src="test/source.xml"/>
>>>>
>>>>         <!-- DEV DEBUG 1 BEGIN -->
>>>>         <map:call resource="log-to-file">
>>>>           <map:parameter name="fileprefix" value="CronCall"/>
>>>>         </map:call>
>>>>         <!-- DEV DEBUG 1 END -->
>>>>
>>>>         <map:serialize type="xml"/>
>>>>       </map:match>
>>>>
>>>> TIA & HAND
>>>>
>>>>
>>>> On Tue, 20 Jan 2009 17:25:50 +0530, Anish <an...@techblue.co.uk>
>>>> wrote:
>>>>> Anish wrote:
>>>>>> Hi
>>>>>>
>>>>>> I've applied cron scheduler to my Cocoon/Lenya Application. I'm 
>>>>>> trying to call a pipeline (which is  publication specific i.e. 
>>>>>> inside publication-sitemap.xmap).
>>>>>>
>>>>>> My call from scheduler reaches to the sitemap but during processing 
>>>>>> it throws :
>>>>>>
>>>>>> org.apache.excalibur.source.SourceException: Cannot get input 
>>>>>> stream for cocoon://mypublication/live/mypage.xml
>>>>>>
>>>>>> due to:
>>>>>>
>>>>>> java.lang.StringIndexOutOfBoundsException: String index out of 
>>>>>> range: -1
>>>>>>
>>>>>> Although my all pipelines work fine inside the publication as I 
>>>>>> access through browser.
>>>>>>
>>>>>> I'm using:
>>>>>>
>>>>>> Cocoon 2.1.7
>>>>>> Lenya 1.2.4
>>>>>> Tomcat 5.5.17
>>>>>>
>>>>>> Please suggest.
>>>>>>
>>>>>> Vik Tara wrote:
>>>>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>>>>> documentation in Cocoon.
>>>>>>>>>       
>>>>>>> I think that's here:
>>>>>>> http://xmlshoestring.com/samples/blocks/cron/samples
>>>>>>>
>>>>>>> Andreas Hartmann wrote:
>>>>>>>  
>>>>>>>> Hi Anish,
>>>>>>>>
>>>>>>>> Anish schrieb:
>>>>>>>>    
>>>>>>>>> I was trying to implement Cocoon Job Scheduler. Please help and
>>>>>>>>> provide me documentation/information as I could hardly find 
>>>>>>>>> relevant
>>>>>>>>> documentation on that.
>>>>>>>>>       
>>>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>>>> documentation in Cocoon.
>>>>>>>>
>>>>>>>> For an example how to schedule a Lenya usecase, consult the API 
>>>>>>>> of the
>>>>>>>> UsecaseScheduler class and use the Publish usecase as an example.
>>>>>>>>
>>>>>>>> -- Andreas
>>>>>>>>
>>>>>>>>
>>>>>>>>     
>>>>>>>
>>>>>>>
> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>>>>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>>>>>
>>>>>>>   
>>>>>>
>>>>>> -- 
>>>>>> Thanks & Regards,
>>>>>> Anish
>>>>> Hi All
>>>>>
>>>>> Thanks, The issue is resolved.
>>>
>>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Job Scheduler in Lenya/Cocoon

Posted by Florent André <fl...@4sengines.com>.
arrrghh !  :)

Thanks for your answer Anish.

On Tue, 24 Mar 2009 14:24:22 +0530, Anish <an...@techblue.co.uk>
wrote:
> Hi Florent
> 
>> The URI prefix is removed when the module sitemap is mounted. And the 
>> pipeline in the above configuration ends with "crontest". So I guess 
>> this should read
>>
>>        <map:match pattern="crontest">
> Even I tried the same way, Andreas suggested.
> 
> It's not working for Lenya 2.0 (as I'm calling a module's internal 
> pipeline). Although pipeline worked fine if called though browser (on 
> http://)

Me too. I also call this pipeline with a <map:generate
src="cocoon://modules/mymodule/crontest"> and it's work... (the
map:generate and the map:match pattern="crontest" are in the same sitemap).

> 
> Earlier I had applied this scheduler for Cocoon 2.1.7/Lenya 1.2.4 
> (without modules) and there it worked.
> (in that case I called  
>  <pipeline>mypublication/live/mycron.xml</pipeline>, this pipeline 
> resides in my publication-sitemap.xmap)

I don't have lenya 1.2.4, so do you know if the difference is : 
- between the cocoon java cron class (I try with
cocoon.components.cron.TestCronJob and
cocoon.components.cron.CocoonPipelineCronJob : nothing work)
- between the lenya's sitemap ?


> 
> I think in the case of Lenya 2.0, module's sitemap is not getting 
> mounted properly.
> 
> I'm trying to resolve this.

Also... because the log have the error : <map:mount> -
file:///var/lib/tomcat5.5/./webapps/lenya/sitemap.xmap:661:106

I try on the sitemap : 
------------------------------------------------------------------
1 - to remplace  : map:mount by map:read (I see an example on the web with
read) in :
 <map:match pattern="**">
        <map:mount check-reload="true" reload-method="synchron"
src="global-sitemap.xmap" uri-prefix=""/>
      </map:match>
(the match pointed by log)
------------------------------------------------------------------
2 - to add :
**** in webapps/lenya/sitemap.xmap 
<map:match pattern="cron/modules/*/**">
        <map:mount uri-prefix="modules/{1}/"
src="{fallback:lenya/modules/{1}/sitemap.xmap}" check-reload="true"
reload-method="synchron"/>
</map:match>
**** in my cocoon.xconf cron's pipeline definition : 
 <pipeline>cron/modules/killbookmakers/crontest</pipeline>

(I'm not really sure with my sitemap.xmap's map:mount definition...)

And nothing work... :(


Open to all suggestions...

++



> 
> 
> 
> 
> Andreas Hartmann wrote:
>> Florent André schrieb:
>>> Hi Anish,
>>>
>>> I think I have the same problem you solve :
>>> org.apache.excalibur.source.SourceException: Cannot get input stream
for
>>> cocoon://modules/mymodule/crontest
>>>
>>> In the component test <pipeline> I try
>>> * modules/mymodule/crontest
>>> * lenya/modules/mymodule/crontest
>>> * mymodule/crontest
>>>
>>> ... but nothing work.
>>>
>>> Can you help me ?
>>>
>>> --- cocoon.conf ---
>>> ## cron component/trigger :
>>>  <triggers>
>>>         <trigger name="test-job1"
>>>                 
target="org.apache.cocoon.components.cron.CronJob/test"
>>>                  concurrent-runs="false">
>>>           <cron>*/2 * * * * ? *</cron>
>>>         </trigger>
>>>       </triggers>
>>>
>>> ##component test :
>>>  <component role="org.apache.cocoon.components.cron.CronJob/test"
>>>              class="org.apache.cocoon.components.cron.TestCronJob"
>>>              logger="cron.test">
>>> <!--    <msg>I'm here</msg>
>>>     <sleep>23000</sleep>-->
>>>     <pipeline>modules/mymodule/crontest</pipeline>
>>>   </component>
>>>
>>>
>>>
>>> --- Mymodule.xmap ---
>>>       <map:match pattern="**/crontest/**">
>>
>> The URI prefix is removed when the module sitemap is mounted. And the 
>> pipeline in the above configuration ends with "crontest". So I guess 
>> this should read
>>
>>        <map:match pattern="crontest">
>>
>> Does it work when you call the URI from the browser instead of the 
>> cron job?
>>
>> Maybe this helps,
>>
>> -- Andreas
>>
>>>
>>>         <map:generate src="test/source.xml"/>
>>>
>>>         <!-- DEV DEBUG 1 BEGIN -->
>>>         <map:call resource="log-to-file">
>>>           <map:parameter name="fileprefix" value="CronCall"/>
>>>         </map:call>
>>>         <!-- DEV DEBUG 1 END -->
>>>
>>>         <map:serialize type="xml"/>
>>>       </map:match>
>>>
>>> TIA & HAND
>>>
>>>
>>> On Tue, 20 Jan 2009 17:25:50 +0530, Anish <an...@techblue.co.uk>
>>> wrote:
>>>> Anish wrote:
>>>>> Hi
>>>>>
>>>>> I've applied cron scheduler to my Cocoon/Lenya Application. I'm 
>>>>> trying to call a pipeline (which is  publication specific i.e. 
>>>>> inside publication-sitemap.xmap).
>>>>>
>>>>> My call from scheduler reaches to the sitemap but during processing 
>>>>> it throws :
>>>>>
>>>>> org.apache.excalibur.source.SourceException: Cannot get input 
>>>>> stream for cocoon://mypublication/live/mypage.xml
>>>>>
>>>>> due to:
>>>>>
>>>>> java.lang.StringIndexOutOfBoundsException: String index out of 
>>>>> range: -1
>>>>>
>>>>> Although my all pipelines work fine inside the publication as I 
>>>>> access through browser.
>>>>>
>>>>> I'm using:
>>>>>
>>>>> Cocoon 2.1.7
>>>>> Lenya 1.2.4
>>>>> Tomcat 5.5.17
>>>>>
>>>>> Please suggest.
>>>>>
>>>>> Vik Tara wrote:
>>>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>>>> documentation in Cocoon.
>>>>>>>>       
>>>>>> I think that's here:
>>>>>> http://xmlshoestring.com/samples/blocks/cron/samples
>>>>>>
>>>>>> Andreas Hartmann wrote:
>>>>>>  
>>>>>>> Hi Anish,
>>>>>>>
>>>>>>> Anish schrieb:
>>>>>>>    
>>>>>>>> I was trying to implement Cocoon Job Scheduler. Please help and
>>>>>>>> provide me documentation/information as I could hardly find 
>>>>>>>> relevant
>>>>>>>> documentation on that.
>>>>>>>>       
>>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>>> documentation in Cocoon.
>>>>>>>
>>>>>>> For an example how to schedule a Lenya usecase, consult the API 
>>>>>>> of the
>>>>>>> UsecaseScheduler class and use the Publish usecase as an example.
>>>>>>>
>>>>>>> -- Andreas
>>>>>>>
>>>>>>>
>>>>>>>     
>>>>>>
>>>>>>
---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>>>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>>>>
>>>>>>   
>>>>>
>>>>> -- 
>>>>> Thanks & Regards,
>>>>> Anish
>>>> Hi All
>>>>
>>>> Thanks, The issue is resolved.
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Job Scheduler in Lenya/Cocoon

Posted by Anish <an...@techblue.co.uk>.
Hi Florent

> The URI prefix is removed when the module sitemap is mounted. And the 
> pipeline in the above configuration ends with "crontest". So I guess 
> this should read
>
>        <map:match pattern="crontest">
Even I tried the same way, Andreas suggested.

It's not working for Lenya 2.0 (as I'm calling a module's internal 
pipeline). Although pipeline worked fine if called though browser (on 
http://)

Earlier I had applied this scheduler for Cocoon 2.1.7/Lenya 1.2.4 
(without modules) and there it worked.
(in that case I called  
 <pipeline>mypublication/live/mycron.xml</pipeline>, this pipeline 
resides in my publication-sitemap.xmap)

I think in the case of Lenya 2.0, module's sitemap is not getting 
mounted properly.

I'm trying to resolve this.




Andreas Hartmann wrote:
> Florent André schrieb:
>> Hi Anish,
>>
>> I think I have the same problem you solve :
>> org.apache.excalibur.source.SourceException: Cannot get input stream for
>> cocoon://modules/mymodule/crontest
>>
>> In the component test <pipeline> I try
>> * modules/mymodule/crontest
>> * lenya/modules/mymodule/crontest
>> * mymodule/crontest
>>
>> ... but nothing work.
>>
>> Can you help me ?
>>
>> --- cocoon.conf ---
>> ## cron component/trigger :
>>  <triggers>
>>         <trigger name="test-job1"
>>                  target="org.apache.cocoon.components.cron.CronJob/test"
>>                  concurrent-runs="false">
>>           <cron>*/2 * * * * ? *</cron>
>>         </trigger>
>>       </triggers>
>>
>> ##component test :
>>  <component role="org.apache.cocoon.components.cron.CronJob/test"
>>              class="org.apache.cocoon.components.cron.TestCronJob"
>>              logger="cron.test">
>> <!--    <msg>I'm here</msg>
>>     <sleep>23000</sleep>-->
>>     <pipeline>modules/mymodule/crontest</pipeline>
>>   </component>
>>
>>
>>
>> --- Mymodule.xmap ---
>>       <map:match pattern="**/crontest/**">
>
> The URI prefix is removed when the module sitemap is mounted. And the 
> pipeline in the above configuration ends with "crontest". So I guess 
> this should read
>
>        <map:match pattern="crontest">
>
> Does it work when you call the URI from the browser instead of the 
> cron job?
>
> Maybe this helps,
>
> -- Andreas
>
>>
>>         <map:generate src="test/source.xml"/>
>>
>>         <!-- DEV DEBUG 1 BEGIN -->
>>         <map:call resource="log-to-file">
>>           <map:parameter name="fileprefix" value="CronCall"/>
>>         </map:call>
>>         <!-- DEV DEBUG 1 END -->
>>
>>         <map:serialize type="xml"/>
>>       </map:match>
>>
>> TIA & HAND
>>
>>
>> On Tue, 20 Jan 2009 17:25:50 +0530, Anish <an...@techblue.co.uk>
>> wrote:
>>> Anish wrote:
>>>> Hi
>>>>
>>>> I've applied cron scheduler to my Cocoon/Lenya Application. I'm 
>>>> trying to call a pipeline (which is  publication specific i.e. 
>>>> inside publication-sitemap.xmap).
>>>>
>>>> My call from scheduler reaches to the sitemap but during processing 
>>>> it throws :
>>>>
>>>> org.apache.excalibur.source.SourceException: Cannot get input 
>>>> stream for cocoon://mypublication/live/mypage.xml
>>>>
>>>> due to:
>>>>
>>>> java.lang.StringIndexOutOfBoundsException: String index out of 
>>>> range: -1
>>>>
>>>> Although my all pipelines work fine inside the publication as I 
>>>> access through browser.
>>>>
>>>> I'm using:
>>>>
>>>> Cocoon 2.1.7
>>>> Lenya 1.2.4
>>>> Tomcat 5.5.17
>>>>
>>>> Please suggest.
>>>>
>>>> Vik Tara wrote:
>>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>>> documentation in Cocoon.
>>>>>>>       
>>>>> I think that's here:
>>>>> http://xmlshoestring.com/samples/blocks/cron/samples
>>>>>
>>>>> Andreas Hartmann wrote:
>>>>>  
>>>>>> Hi Anish,
>>>>>>
>>>>>> Anish schrieb:
>>>>>>    
>>>>>>> I was trying to implement Cocoon Job Scheduler. Please help and
>>>>>>> provide me documentation/information as I could hardly find 
>>>>>>> relevant
>>>>>>> documentation on that.
>>>>>>>       
>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>> documentation in Cocoon.
>>>>>>
>>>>>> For an example how to schedule a Lenya usecase, consult the API 
>>>>>> of the
>>>>>> UsecaseScheduler class and use the Publish usecase as an example.
>>>>>>
>>>>>> -- Andreas
>>>>>>
>>>>>>
>>>>>>     
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>>>
>>>>>   
>>>>
>>>> -- 
>>>> Thanks & Regards,
>>>> Anish
>>> Hi All
>>>
>>> Thanks, The issue is resolved.
>
>


-- 
Anish Sneh
Software Engineer
Techblue Softwares Pvt. Ltd.
www.technologyblueprint.co.uk




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Job Scheduler in Lenya/Cocoon

Posted by Andreas Hartmann <an...@apache.org>.
Florent André schrieb:
> Hi Anish,
> 
> I think I have the same problem you solve : 
> 
> org.apache.excalibur.source.SourceException: Cannot get input stream for
> cocoon://modules/mymodule/crontest
> 
> In the component test <pipeline> I try
> * modules/mymodule/crontest
> * lenya/modules/mymodule/crontest
> * mymodule/crontest
> 
> ... but nothing work.
> 
> Can you help me ?
> 
> --- cocoon.conf ---
> ## cron component/trigger :
>  <triggers>
>         <trigger name="test-job1"
>                  target="org.apache.cocoon.components.cron.CronJob/test"
>                  concurrent-runs="false">
>           <cron>*/2 * * * * ? *</cron>
>         </trigger>
>       </triggers>
> 
> ##component test :
>  <component role="org.apache.cocoon.components.cron.CronJob/test"
>              class="org.apache.cocoon.components.cron.TestCronJob"
>              logger="cron.test">
> <!--    <msg>I'm here</msg>
>     <sleep>23000</sleep>-->
>     <pipeline>modules/mymodule/crontest</pipeline>
>   </component>
> 
> 
> 
> --- Mymodule.xmap ---
>       <map:match pattern="**/crontest/**">

The URI prefix is removed when the module sitemap is mounted. And the 
pipeline in the above configuration ends with "crontest". So I guess 
this should read

        <map:match pattern="crontest">

Does it work when you call the URI from the browser instead of the cron job?

Maybe this helps,

-- Andreas

> 
>         <map:generate src="test/source.xml"/>
> 
>         <!-- DEV DEBUG 1 BEGIN -->
>         <map:call resource="log-to-file">
>           <map:parameter name="fileprefix" value="CronCall"/>
>         </map:call>
>         <!-- DEV DEBUG 1 END -->
> 
>         <map:serialize type="xml"/>
>       </map:match>
> 
> TIA & HAND
> 
> 
> On Tue, 20 Jan 2009 17:25:50 +0530, Anish <an...@techblue.co.uk>
> wrote:
>> Anish wrote:
>>> Hi
>>>
>>> I've applied cron scheduler to my Cocoon/Lenya Application. I'm trying 
>>> to call a pipeline (which is  publication specific i.e. inside 
>>> publication-sitemap.xmap).
>>>
>>> My call from scheduler reaches to the sitemap but during processing it 
>>> throws :
>>>
>>> org.apache.excalibur.source.SourceException: Cannot get input stream 
>>> for cocoon://mypublication/live/mypage.xml
>>>
>>> due to:
>>>
>>> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>>>
>>> Although my all pipelines work fine inside the publication as I access 
>>> through browser.
>>>
>>> I'm using:
>>>
>>> Cocoon 2.1.7
>>> Lenya 1.2.4
>>> Tomcat 5.5.17
>>>
>>> Please suggest.
>>>
>>> Vik Tara wrote:
>>>>>> for general scheduling tasks, take a look at the cron block API
>>>>>> documentation in Cocoon.
>>>>>>       
>>>> I think that's here:
>>>> http://xmlshoestring.com/samples/blocks/cron/samples
>>>>
>>>> Andreas Hartmann wrote:
>>>>   
>>>>> Hi Anish,
>>>>>
>>>>> Anish schrieb:
>>>>>     
>>>>>> I was trying to implement Cocoon Job Scheduler. Please help and
>>>>>> provide me documentation/information as I could hardly find relevant
>>>>>> documentation on that.
>>>>>>       
>>>>> for general scheduling tasks, take a look at the cron block API
>>>>> documentation in Cocoon.
>>>>>
>>>>> For an example how to schedule a Lenya usecase, consult the API of the
>>>>> UsecaseScheduler class and use the Publish usecase as an example.
>>>>>
>>>>> -- Andreas
>>>>>
>>>>>
>>>>>     
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>>
>>>>   
>>>
>>> -- 
>>> Thanks & Regards,
>>> Anish
>> Hi All
>>
>> Thanks, The issue is resolved.


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org