-
1. Re: How to create a Timer on a task-node?
asmo Jan 11, 2007 9:03 AM (in response to dasriharsha)Is the timer created in the database?
If so, make sure that the scheduler is running. -
2. Re: How to create a Timer on a task-node?
dasriharsha Jan 11, 2007 1:32 PM (in response to dasriharsha)Yes the timer is getting created in JBPM_TIMER table. But the handler is not getting executed. Iam throwing back the exception that is caught in the handler. So i see the following exception in the JBPM_TIMER table.
java.lang.Exception: Exception in the VideoTranscodeMonitorHandler org.jbpm.bytes.ByteArray$$EnhancerByCGLIB$$afee7672 at com.ge.nbc.content.process.video.handler.VideoTranscodeMonitorHandler.execute(VideoTranscodeMonitorHandler.java:55) at org.jbpm.graph.def.Action.execute(Action.java:123) 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:585) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:185) at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$9c43d20f.execute(<generated>) at org.jbpm.scheduler.exe.Timer.execute(Timer.java:84) at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:118) at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
How do i make sure that the Scheduler is running. Looking at the error trace i think its running.
Is there anything that iam missing.
Regards
Harsha -
3. Re: How to create a Timer on a task-node?
asmo Jan 11, 2007 3:38 PM (in response to dasriharsha)If the scheduler start you should see something like this:
21:22:44,375 DEBUG [Scheduler] starting the scheduler
And after that, the scheduler should check the database for timer every 5 seconds ( i think 5 seconds is the default value, but i am not sure...) and you can see this:21:24:12,328 DEBUG [SchedulerThread] checking for timers
Otherwise, you must start the scheduler.
You could do this in the web.xml. there you must config the scheduler simular to this ( i don t use the scheduler servlet, so i don t know, if this is exactly right).<servlet> <servlet-name>JbpmThreadsServlet</servlet-name> <servlet-class>org.jbpm.web.JbpmThreadsServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>JbpmThreadsServlet</servlet-name> <url-pattern>/threads</url-pattern> </servlet-mapping>
Alternative you could start the main method of the org.jbpm.scheduler.impl.SchedulerThread.
I do this with java reflection in a java class, but i have no big java experience, so this is may not the best way, but it works... :-)String[] nargs = {"4000", "40" ,"dd/MM/yyyy HH:mm:ss"}; Class sched = Class.forName( "org.jbpm.scheduler.impl.SchedulerMain"); Method[] methods = sched.getMethods(); logger.info("Die methoden: " +methods.toString()); Method methode = sched.getMethod( "main" , nargs.getClass()); logger.info("Die methode: " + methode.toString()); methode.invoke( null, new Object[]{nargs} );
Regards
asmo -
4. Re: How to create a Timer on a task-node?
kukeltje Jan 11, 2007 4:13 PM (in response to dasriharsha)is it me or??????
according to the stacktrace the scheduler IS running (just like mentioned) AND the handler is called since it THROWS AN EXCEPTION (just like mentioned)....
So the problem is not that the handler is not getting called, but that it throws an exception...
Correct me if I'm wrong, otherwise pay better attention in the future... oh... and better formulate the subject -
5. Re: How to create a Timer on a task-node?
asmo Jan 11, 2007 5:07 PM (in response to dasriharsha)you are right.
i try to pay better attention next time.... -
6. Re: How to create a Timer on a task-node?
dasriharsha Jan 11, 2007 7:49 PM (in response to dasriharsha)The scheduler thread is running and the exception is because of an older version of the Handler that was deployed. So i cleaned up the JBPM tables and deployed the handlers again.
It worked.
Thanks for all the help.
Regards
Harsha -
7. Re: How to create a Timer on a task-node?
kukeltje Jan 12, 2007 3:45 AM (in response to dasriharsha)I did not want to offend anyone, jsut save us all from spending to much time on issues that aren't realy there.