[opencms-dev] problem in using collector
Farnaz Fotrousi
f_fotrousi at yahoo.com
Mon Jan 30 08:44:51 CET 2006
Hi,
I need to have a scheduled task which collect some XML files and use their contents. So I make a collector in launch method of a class which implements I_CmsScheduledJob.
But when I try to run it, CmsVfsResourceNotFoundException happens. Although I can run this simple code in a jsp file and works fine, but I have problem to run it in a java class.
error likes:
org.opencms.file.CmsVfsResourceNotFoundException: Error reading resource from path "/test/modules/news/".
at org.opencms.file.CmsVfsResourceNotFoundException.createException(CmsVfsResourceNotFoundException.java:78)
at org.opencms.db.CmsDbContext.throwException(CmsDbContext.java:213)
at org.opencms.db.CmsDbContext.report(CmsDbContext.java:197)
at org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:3838)
at org.opencms.file.CmsObject.readResource(CmsObject.java:2658)
at org.opencms.file.CmsObject.readResources(CmsObject.java:2694)
at org.opencms.file.collectors.CmsDefaultResourceCollector.getAllInFolder(CmsDefaultResourceCollector.java:309)
at org.opencms.file.collectors.CmsDefaultResourceCollector.getResults(CmsDefaultResourceCollector.java:177)
at org.opencms.scheduler.jobs.CmsNewsletterJob.launch(CmsNewsletterJob.java:38)
at org.opencms.scheduler.CmsScheduleManager.execute(CmsScheduleManager.java:171)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.opencms.scheduler.CmsSchedulerThread.run(CmsSchedulerThread.java:123)
Caused by: org.opencms.file.CmsVfsResourceNotFoundException: Unable to read resource "/test/modules/news".
at org.opencms.db.generic.CmsVfsDriver.readResource(CmsVfsDriver.java:1431)
at org.opencms.db.CmsDriverManager.readResource(CmsDriverManager.java:5535)
at org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:5589)
at org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:3836)
... 8 more
my code is as simple as:
String param="/test/modules/news/"+"|xmlcontent|10";
I_CmsResourceCollector collector = OpenCms.getResourceManager().getContentCollector("allInFolder");
List m_collectorResult = collector.getResults(cms, "allInFolder",param);
How should I have the 'param'?
Would you please tell me what is wrong with me?
How to use macro such as using it in contentload tag in my code? I mean how I can have something like 'news_${number}.html' in a java class?
Regards,
Farnaz Fotrousi.
---------------------------------
Do you Yahoo!?
With a free 1 GB, there's more in store with Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060129/e8813738/attachment.htm>
More information about the opencms-dev
mailing list