我面临一个集成cocoon管道和CocoonPipelineCronJob调度程序的问题。
我的cocoon.xconf快照代码如下
<trigger name="pipeline-writetest"
target="org.apache.cocoon.components.cron.CronJob/writetimecron"
concurrent-runs="false">
<cron>10 * * ? * *</cron>
</trigger>
</triggers>
<component role="org.apache.cocoon.components.cron.CronJob/writetimecron"
class="org.apache.cocoon.components.cron.CocoonPipelineCronJob"
logger="cron.writetimecron">
<sleep>10</sleep>
<pipeline>writetime</pipeline>
</component>
and my pipeline configure in sitemap.xmap as below
<map:pipeline internal-only="false">
<map:match pattern="writetime">
.....<!-- all generator,transformer and serialier code ..-->
</map:match>
</map:pipeline>
信息Tomcat: apache-tomcat-6.0.30 Cocoon:2.1和 如果我,我的管道运作良好 从外部访问..
但如果我从我的cronjob调用此管道,那么我在cocoon.log中收到以下错误
INFO (2011-02-06) 12:54.10:018 [cron] (Unknown-URI) Unknown-Thread/QuartzJobExecutor: Executing cron job named 'pipeline-writetest'
ERROR (2011-02-06) 12:54.10:019 [cron] (Unknown-URI) Unknown-Thread/QuartzJobExecutor: Cron job name 'pipeline-writetest' died.
java.net.MalformedURLException: The cocoon protocol can not be used outside an environment.
at org.apache.cocoon.components.source.impl.SitemapSource.<init>(SitemapSource.java:119)
at org.apache.cocoon.components.source.impl.SitemapSourceFactory.getSource(SitemapSourceFactory.java:65)
at org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:208)
at org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
at org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:541)
at org.apache.cocoon.components.cron.CocoonPipelineCronJob.execute(CocoonPipelineCronJob.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocationHandler.invoke(ComponentProxyGenerator.java:143)
at $Proxy6.execute(Unknown Source)
at org.apache.cocoon.components.cron.QuartzJobExecutor.execute(QuartzJobExecutor.java:103)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
如果你遇到同样的问题或者你知道解决这个问题,请告诉我。