[opencms-dev] Can i schedule a .jsp file to run as a cron job
Kelvin
kelvin.ang at resonance.com.sg
Thu Aug 5 05:50:02 CEST 2004
I wrote a class file to try create a file on the root directory and put it
as a cron job. I keep getting the error below when the cron job is ran:
--> com.opencms.core.CmsException:
[com.opencms.file.mySql.CmsResourceBroker] /default/vfs/testfile
my entry on the scheduled task is:
--> 36 11 * * * admin Administrators org.opencms.templates.recentNews testfile
And this is my code -->
---------------------------------
public class recentNews implements I_CmsCronJob {
public String launch(CmsObject cms, String parameter) throws Exception {
String file_name=new String(parameter);
String foldername = "/";
CmsFile file;
try{
String content = "abbbbbbbbb";
cms.createFile(foldername,file_name,content.getBytes(),"plain");
file = cms.readFile(parameter);
cms.unlockResource(parameter);
}catch(Exception e){
System.out.println(e.getMessage());
}
return null;
}
}
At 09:31 AM 8/5/2004, you wrote:
>One way you could work it is if you write a class implementing
>I_CmsCronJob that takes a url as a parameter and that then opens a http
>connection to the url requested.
>
>Kind regards,
>
>Martijn Schiferli
>
>Schiferli.Com
>70 Roper Road
>BLUE HAVEN NSW 2262
>Australia
>
>ABN 16 08 32 81 537
>P 02 43904559
>M 0405 207718
>Email Martijn at Schiferli.com
>
>
>-----Original Message-----
>From: opencms-dev-admin at opencms.org
>[mailto:opencms-dev-admin at opencms.org] On Behalf Of Thomas Joseph Olaes
>Sent: Thursday, 5 August 2004 9:58 AM
>To: opencms-dev at opencms.org
>Subject: Re: [opencms-dev] Can i schedule a .jsp file to run as a cron
>job
>
>
>Sorry, meant "Kelvin"
>
>-TJ
>
>On Wed, 4 Aug 2004 16:54:06 -0700, Thomas Joseph Olaes
><thomas.olaes at gmail.com> wrote:
> > Hey Kevin,
> >
> > I don't think there is a way to do that, unless you port your JSP
> > script into a class that implements I_CmsCronJob
> >
> > -TJ
> >
> >
> >
> > On Wed, 04 Aug 2004 16:28:10 +0000, kelvin a <ah_ant45 at hotmail.com>
> > wrote:
> > > Hi all,
> > >
> > > I have some jsp scripts that I would like to run as cron jobs over
> > > opencms. Is there anyway way that I can do that? I only know how to
> > > set the "Schedule Task" to run java class files. Is there anyway to
> > > set the "schedule task" to run .jsp files? Hope someone have an
> > > answer to that. Thanks a lot
> > >
> > > Cheers,
> > > Kelvin
> > >
> > > _________________________________________________________________
> > > Preview the new MSN Search with MSN Search Tech Preview.
> > > http://techpreview.search.msn.com.sg/
> > >
> > > _______________________________________________
> > > This mail is send to you from the opencms-dev mailing list To change
>
> > > your list options, or to unsubscribe from the list, please visit
> > > http://mail.opencms.org/mailman/listinfo/opencms-dev
> > >
> >
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please
>visit http://mail.opencms.org/mailman/listinfo/opencms-dev
>
>
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list