我面临一个集成茧管道和 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)
如果您以前遇到同样的问题或者您知道解决方案,请告诉我。