I am testing cron block and found out some problems. I am using the
TestCronJob supplied. I have uncommented the trigger section so the job is
scheduled automatically at startup (
<trigger name="test-job1"
     target="org.apache.cocoon.components.cron.CronJob/test"
     concurrent-runs="false">
     <cron>*/12 * * * * ? *</cron>
</trigger> 

Below you will find the log with errors. For some first runs there is a NPE in
sitemap. After a while it starts working with no problem. Looks like the
sitemap is not ready to receive requests?

INFO    (2004-01-29) 11:03.20:734   [cron] Unknown-thread/QuartzJobScheduler:
using a PooledExecutor as ThreadPool with
queueing=false,max-pool-size=2147483647,min-pool-size=1,keep-alive-time-ms=600
00,block-policy='RUN',shutdown-wait-time-ms=5000
INFO    (2004-01-29) 11:03.20:828   [cron] Unknown-thread/QuartzJobScheduler:
Adding CronJob 'Cocoon.test-job1'
DEBUG   (2004-01-29) 11:03.20:828   [cron] Unknown-thread/QuartzJobScheduler:
Time schedule summary:
seconds: 0,12,24,36,48
minutes: *
hours: *
daysOfMonth: *
months: *
daysOfWeek: ?
lastdayOfWeek: false
NthDayOfWeek: 0
lastdayOfMonth: false
calendardayOfWeek: false
calendardayOfMonth: false
years: *

INFO    (2004-01-29) 11:03.24:000   [cron] Unknown-thread/QuartzJobExecutor:
Scheduling cron job named 'test-job1'
INFO    (2004-01-29) 11:03.24:015   [cron.test] Unknown-thread/TestCronJob:
CronJob test-job1 launched at Thu Jan 29 11:03:24 CET 2004 with message 'I'm
here' and sleep timeout of 23000ms
ERROR   (2004-01-29) 11:03.24:046   [cron.test] Unknown-thread/TestCronJob:
error in execution of TestCronJob
org.apache.cocoon.ProcessingException: Failed to load sitemap from
file:/C:/DevTools/cocoon.current/sitemap.xmap: java.lang.NullPointerException
        at
org.apache.cocoon.components.treeprocessor.DefaultTreeBuilder.build(DefaultTre
eBuilder.java:395)
        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.setupRootNode(TreePro
cessor.java:511)
        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor
.java:348)
        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor
.java:307)
        at
org.apache.cocoon.components.cron.AbstractPipelineCallingCronJob.process(Abstr
actPipelineCallingCronJob.java:122)
        at
org.apache.cocoon.components.cron.AbstractPipelineCallingCronJob.process(Abstr
actPipelineCallingCronJob.java:99)
        at
org.apache.cocoon.components.cron.TestCronJob.execute(TestCronJob.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
ava:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocat
ionHandler.invoke(ComponentProxyGenerator.java:182)
        at $Proxy6.execute(Unknown Source)
        at
org.apache.cocoon.components.cron.QuartzJobExecutor.execute(QuartzJobExecutor.
java:130)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:147)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.NullPointerException
        at
org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:197)
        at
org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:128)
        at
org.apache.cocoon.components.treeprocessor.DefaultTreeBuilder.build(DefaultTre
eBuilder.java:388)
        ... 16 more
java.lang.NullPointerException
        at
org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:197)
        at
org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:128)
        at
org.apache.cocoon.components.treeprocessor.DefaultTreeBuilder.build(DefaultTre
eBuilder.java:388)
        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.setupRootNode(TreePro
cessor.java:511)
        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor
.java:348)
        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor
.java:307)
        at
org.apache.cocoon.components.cron.AbstractPipelineCallingCronJob.process(Abstr
actPipelineCallingCronJob.java:122)
        at
org.apache.cocoon.components.cron.AbstractPipelineCallingCronJob.process(Abstr
actPipelineCallingCronJob.java:99)
        at
org.apache.cocoon.components.cron.TestCronJob.execute(TestCronJob.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
ava:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocat
ionHandler.invoke(ComponentProxyGenerator.java:182)
        at $Proxy6.execute(Unknown Source)
        at
org.apache.cocoon.components.cron.QuartzJobExecutor.execute(QuartzJobExecutor.
java:130)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:147)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
        at java.lang.Thread.run(Thread.java:534)
ERROR   (2004-01-29) 11:03.24:046   [cron] Unknown-thread/QuartzJobExecutor:
Cron job name 'test-job1 died.
java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:61)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
        at
org.apache.cocoon.components.cron.TestCronJob.execute(TestCronJob.java:120)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
ava:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocat
ionHandler.invoke(ComponentProxyGenerator.java:182)
        at $Proxy6.execute(Unknown Source)
        at
org.apache.cocoon.components.cron.QuartzJobExecutor.execute(QuartzJobExecutor.
java:130)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:147)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
        at java.lang.Thread.run(Thread.java:534)


-- 
    Leszek Gawron


Reply via email to