Questions tagged [cron4j]

Cron4j is a scheduler for the Java platform which is very similar to the UNIX cron daemon.

Cron4j is a scheduler for the Java platform which is very similar to the UNIX cron daemon. With cron4j you can launch, from within your Java applications, any task you need at the right time, according to some simple rules.

See http://www.sauronsoftware.it/projects/cron4j/

22 questions
3
votes
2 answers

cron4j: Schedule multiple tasks with different schedule time

I don't have experience with cron4j scheduler and I need to schedule tasks with different time. Use cron4j is requirement, so I have to use it. I've tried to find tutorial but unsuccessfully. Can someone help me. I don't want full code here now,…
Martin
  • 2,146
  • 4
  • 21
  • 32
3
votes
4 answers

How to schedule execution of something more frequently then by the minute?

Currently, using cron4j, i am able to schedule execution of an event at, say 13:01. While fine, from what i understand it does not allow one to schedule an event at 13:01:10 (10 seconds after). Is there a tool that allows such granularity in…
James Raitsev
  • 92,517
  • 154
  • 335
  • 470
2
votes
1 answer

Guice scope for scheduled job run

My application is built on top of Guice and runs scheduled jobs (cron4j), which are showing some issues related to inherently @Singleton instances. The appropriate solution to my problem seems to have Scope that would be applicable for each job run,…
everton
  • 7,579
  • 2
  • 29
  • 42
2
votes
0 answers

Why only some classes on jar are found

does anyone know how can java find only part of the jar? I created a lib that does some reporting and I'm integrating it into many different projects. This particular error only happens on those running inside tomcat. Exception in thread…
Gust
  • 195
  • 1
  • 15
2
votes
1 answer

Java cron4j scheduled files

I am using the cron4j library for scheduling a program. Here is my code: public class Main { public static void main(String[] args) { // Declares the file. File file = new File("cron4j.txt"); // Creates the scheduler. Scheduler…
CodeKingPlusPlus
  • 15,383
  • 51
  • 135
  • 216
2
votes
1 answer

cron4j descheduling tasks on servlet/actionbean

I have used cron4j to start a task to email people daily on certain conditions (they haven't done their job) using Stripes ActionBean. I saved the task id in MySQL. However, I cannot seem to stop it. I tried using the id to deschedule the task, but…
Aladdin Teng
  • 330
  • 1
  • 2
  • 13
1
vote
0 answers

Get al scheduled tasks from CRON4J Scheduler

I am using cron4j to manage timing of some tasks. I have a need to be able to get a list of all tasks added to a given scheduler. Please note that I care about MORE than simply the tasks that are currently executing. I was trying to use this…
Deslyxia
  • 619
  • 4
  • 11
  • 32
1
vote
1 answer

SchedulingPattern con4j every 2 minutes 30 second or 150 seconds

I have Scheduler use do run every 2 minutes. but i can't use to 2m30s.Please help me SchedulingPattern pattern = new SchedulingPattern("*/2 * * * *");
Dat Nguyen
  • 784
  • 1
  • 5
  • 14
1
vote
2 answers

How to check a date satisfies a cron pattern in cron4j

In Quartz, we can tell if a date satisfies a cron pattern by calling CronExpression.isSatisfiedBy(date). May I know how to do the same in cron4j? Thank you!
Hez
  • 125
  • 2
  • 11
1
vote
1 answer

Using cron4j, I have separate tasks that need separate schedules.

Ok, so I have two schedules as below. You can see that I have my executor service as well as a new instance of scheduler. Seeing as I have a single instance of scheduler, and I have two tasks I want to run at different times. Does this mean that in…
TheMightyLlama
  • 1,243
  • 1
  • 19
  • 51
1
vote
1 answer

java cron solution with completion checking

I am looking for a simple cron-type solution for java-application. I looked at cron4j, where you can set up a method to execute, for example every 5 minutes. Only, I have a custom requirement that, if the previous method call is still running, it…
Rop
  • 3,359
  • 3
  • 38
  • 59
1
vote
2 answers

We have a web application which uses CRON4J scheduling. The Jobs are running twice for same scheduling time. can anybody know why?

We have a web application which uses CRON4J scheduling. The Jobs are running twice for same scheduling time. can anybody know why? we deployed this app on tomcat.
0
votes
1 answer

How to schedule cron4j on Tomcat startup?

I want my web server (Tomcat 8.5) to send emails automatically once every day while it's running. So I configured a StartUp-Servlet in web.xml to run on server startup. When I test it in eclipse, I get the error Starting Tomcat v8.5 Server at…
Merha
  • 119
  • 13
0
votes
1 answer

Start a schedule when current running schedule hasn't finished yet Cron4j

I'm using Cron4j to create backup schedules for a database. Assume that we had 2 schedules, the first started at 5.00 pm, and the second started at 5.30 pm, both at the same day. I don't know what would happend if the backup time of the first…
user6907216
0
votes
1 answer

Run cron4j at multiple different times

I need to write a Java class, which fetches different times from a database and then calls a function at those times. The times can change in the database and a value corresponding to the time in the Db is sent as arguments to the function. I need…
Yajat Singh
  • 43
  • 1
  • 1
  • 8
1
2