You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jürgen Hoffmann <jh...@byteaction.de> on 2002/08/29 13:19:41 UTC
Fulcrum scheduled service
Hi all,
I have a scheduled service that is doing a job developed with tdk
2.2-b2. But when I start the Job I get the following error:
[Thu Aug 29 13:05:10 CEST 2002] -- ERROR --
Exception: java.lang.reflect.InvocationTargetException
Stack Trace follows:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
.
.
.
at java.lang.Thread.run(Thread.java:539)
Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/lang/Objects
at
org.apache.fulcrum.schedule.BaseJobEntry.setJobId(BaseJobEntry.java:102)
at
org.apache.fulcrum.schedule.BaseJobEntryPeer.populateObject(BaseJobEntry
Peer.java:261)
at
org.apache.fulcrum.schedule.BaseJobEntryPeer.row2Object(BaseJobEntryPeer
.java:224)
at
org.apache.fulcrum.schedule.BaseJobEntryPeer.populateObjects(BaseJobEntr
yPeer.java:354)
at
org.apache.fulcrum.schedule.BaseJobEntryPeer.doSelect(BaseJobEntryPeer.j
ava:283)
at
org.apache.fulcrum.schedule.TurbineSchedulerService.init(TurbineSchedule
rService.java:116)
at
org.apache.fulcrum.BaseServiceBroker.getService(BaseServiceBroker.java:5
74)
at
com.ba.contentanalysis.modules.actions.SchedulerStart.doStarttask(Schedu
lerStart.java:28)
... 47 more
Here is my Code:
The Job to be executed looks like this
package com.ba.ca.modules.scheduled;
import org.apache.fulcrum.schedule.ScheduledJob;
import org.apache.fulcrum.schedule.JobEntry;
public class Analyzer extends ScheduledJob
{
...
}
The Form looks like this:
$page.setTitle("SimpleScheduleTask Starter Page")
Set Values for SimpleScheduleTask and then start it for the first time.
<br />
<form>
<input type="hidden" name="action" value="SchedulerStart" />
Sekunde: <input type="text" name="second" size="20" /> : seconds
(0-59)<br />
Minute: <input type="text" name="minute" size="20" /> : minutes
(0-59)<br />
Stunde: <input type="text" name="hour" size="20" /> : hours (0-23)<br />
Wochentag: <input type="text" name="weekday" size="20" /> : Day of the
Week (1-7)<br />
Monatstag: <input type="text" name="day_of_month" size="20" /> Day of
the Month (1-31)<br />
Aufgabe: <input type="text" name="task" value="Analyzer" /> : The Task
being scheduled. <br />
Email: <input type="text" name="email" /> : Email<br />
<input type="submit" name="eventSubmit_doStarttask" value="Task starten"
/>
</form>
And the action like this:
package com.ba.ca.modules.actions;
import org.apache.turbine.modules.actions.VelocityAction;
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.ParameterParser;
import org.apache.velocity.context.Context;
import org.apache.fulcrum.schedule.ScheduleService;
import org.apache.fulcrum.schedule.JobEntry;
import org.apache.fulcrum.TurbineServices;
import org.apache.turbine.util.Log;
public class SchedulerStart extends VelocityAction
{
public void doStarttask( RunData data ) throws Exception
{
ParameterParser pp = data.getParameters();
int sec = pp.getInt("second", -1);
int min = pp.getInt("minute", -1);
int hrs = pp.getInt("hour", -1);
int wed = pp.getInt("weekday", -1);
int dom = pp.getInt("day_of_month", -1);
String task = pp.getString("task","");
String email = pp.getString("email","");
try
{
ScheduleService ss =
(ScheduleService)TurbineServices.getInstance().getService(ScheduleServic
e.SERVICE_NAME);
JobEntry je = new JobEntry(sec,min,hrs,wed,dom,task);
je.setEmail(email);
ss.addJob(je);
data.setMessage("Task " + task + " started successfully");
}
catch (Exception e)
{
Log.info(e.toString());
data.setMessage("Task " + task + " failed to Start");
}
setTemplate(data, "files,AllFiles.vm");
}
public void doPerform( RunData data, Context context ) throws
Exception
{
doStarttask( data );
}
}
Can someone please tell me where to look for the error?
Kind regards
Jürgen Hoffmann
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Fulcrum scheduled service
Posted by Fabio Daprile <fa...@wuerth-phoenix.com>.
Hello Jurgen,
i'm getting crazy to have the fulcrum scheduler to work.
Can you share with me your configuration files and the classes you used
to make it running?
I'll be grateful.
greetings
Fabio Daprile
Jürgen Hoffmann wrote:
>Hi all,
>
>I have a scheduled service that is doing a job developed with tdk
>2.2-b2. But when I start the Job I get the following error:
>
>[Thu Aug 29 13:05:10 CEST 2002] -- ERROR --
> Exception: java.lang.reflect.InvocationTargetException
> Stack Trace follows:
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .
> .
> .
> at java.lang.Thread.run(Thread.java:539)
>Caused by: java.lang.NoClassDefFoundError:
>org/apache/commons/lang/Objects
> at
>org.apache.fulcrum.schedule.BaseJobEntry.setJobId(BaseJobEntry.java:102)
> at
>org.apache.fulcrum.schedule.BaseJobEntryPeer.populateObject(BaseJobEntry
>Peer.java:261)
> at
>org.apache.fulcrum.schedule.BaseJobEntryPeer.row2Object(BaseJobEntryPeer
>.java:224)
> at
>org.apache.fulcrum.schedule.BaseJobEntryPeer.populateObjects(BaseJobEntr
>yPeer.java:354)
> at
>org.apache.fulcrum.schedule.BaseJobEntryPeer.doSelect(BaseJobEntryPeer.j
>ava:283)
> at
>org.apache.fulcrum.schedule.TurbineSchedulerService.init(TurbineSchedule
>rService.java:116)
> at
>org.apache.fulcrum.BaseServiceBroker.getService(BaseServiceBroker.java:5
>74)
> at
>com.ba.contentanalysis.modules.actions.SchedulerStart.doStarttask(Schedu
>lerStart.java:28)
> ... 47 more
>
>Here is my Code:
>
>The Job to be executed looks like this
>
>package com.ba.ca.modules.scheduled;
>import org.apache.fulcrum.schedule.ScheduledJob;
>import org.apache.fulcrum.schedule.JobEntry;
>
>public class Analyzer extends ScheduledJob
>{
> ...
>}
>
>The Form looks like this:
>$page.setTitle("SimpleScheduleTask Starter Page")
>
>Set Values for SimpleScheduleTask and then start it for the first time.
><br />
>
><form>
><input type="hidden" name="action" value="SchedulerStart" />
>Sekunde: <input type="text" name="second" size="20" /> : seconds
>(0-59)<br />
>Minute: <input type="text" name="minute" size="20" /> : minutes
>(0-59)<br />
>Stunde: <input type="text" name="hour" size="20" /> : hours (0-23)<br />
>Wochentag: <input type="text" name="weekday" size="20" /> : Day of the
>Week (1-7)<br />
>Monatstag: <input type="text" name="day_of_month" size="20" /> Day of
>the Month (1-31)<br />
>Aufgabe: <input type="text" name="task" value="Analyzer" /> : The Task
>being scheduled. <br />
>Email: <input type="text" name="email" /> : Email<br />
><input type="submit" name="eventSubmit_doStarttask" value="Task starten"
>/>
></form>
>
>And the action like this:
>
>package com.ba.ca.modules.actions;
>
>import org.apache.turbine.modules.actions.VelocityAction;
>import org.apache.turbine.util.RunData;
>import org.apache.turbine.util.ParameterParser;
>import org.apache.velocity.context.Context;
>import org.apache.fulcrum.schedule.ScheduleService;
>import org.apache.fulcrum.schedule.JobEntry;
>import org.apache.fulcrum.TurbineServices;
>import org.apache.turbine.util.Log;
>
>public class SchedulerStart extends VelocityAction
>{
>
> public void doStarttask( RunData data ) throws Exception
> {
> ParameterParser pp = data.getParameters();
> int sec = pp.getInt("second", -1);
> int min = pp.getInt("minute", -1);
> int hrs = pp.getInt("hour", -1);
> int wed = pp.getInt("weekday", -1);
> int dom = pp.getInt("day_of_month", -1);
> String task = pp.getString("task","");
> String email = pp.getString("email","");
>
> try
> {
> ScheduleService ss =
>(ScheduleService)TurbineServices.getInstance().getService(ScheduleServic
>e.SERVICE_NAME);
> JobEntry je = new JobEntry(sec,min,hrs,wed,dom,task);
> je.setEmail(email);
> ss.addJob(je);
> data.setMessage("Task " + task + " started successfully");
> }
> catch (Exception e)
> {
> Log.info(e.toString());
> data.setMessage("Task " + task + " failed to Start");
> }
>
> setTemplate(data, "files,AllFiles.vm");
> }
>
> public void doPerform( RunData data, Context context ) throws
>Exception
> {
> doStarttask( data );
> }
>}
>
>Can someone please tell me where to look for the error?
>
>Kind regards
>
>Jürgen Hoffmann
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
--
Fabio Daprile
Würth-Phoenix Srl
Via Kravogl 4, I-39100 Bolzano
Tel: +39 0471/564111 - (direct 564068)
Fax: +39 0471/564122
mailto:fabio.daprile@wuerth-phoenix.com
http://www.wuerth-phoenix.com
http://www.wuerth.com
===============================================================================
CONFIDENTIALITY NOTICE: E-mail may contain confidential information that is
legally privileged. Do not read this e-mail if you are not the intended
recipient.
This e-mail transmission, and any documents, files or previous e-mail
messages attached to it may contain confidential information that is legally
privileged. If you are not the intended recipient, or a person responsible
for delivering it to the intended recipient, you are hereby notified that any
disclosure, copying, distribution or use of any of the information contained
in or attached to this transmission is STRICTLY PROHIBITED. If you have
received this transmission in error, please immediately notify us by reply
e-mail or by telephone at (+39) 0471-564111, and destroy the original
transmission and its attachments without reading or saving in any manner.
Thank you.
===============================================================================
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>