Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

quartz scheduler sample program giving error

I am trying to run the sample helloworld program for quartz scheduling given on roseindi.net http://www.roseindia.net/quartz/quartz-scheduler-tutorial.shtml

I have both the classes given there exactly similar setup in my java projecy with quartz version 1.6 - all.jar in the project library. When I try to run the application I get the following Exception

Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/UserTransaction
    at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1104)
    at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1355)
    at oiaoerpdataconnector.HelloSchedule.HelloScheduleRun(HelloSchedule.java:25)
    at oiaoerpdataconnector.HelloSchedule.main(HelloSchedule.java:37)
Caused by: java.lang.ClassNotFoundException: javax.transaction.UserTransaction
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 4 more
Java Result: 1

What am I missing here?
Thanks,
Priyank

like image 601
pri_dev Avatar asked Mar 07 '12 20:03

pri_dev


People also ask

Why we should not use Quartz Scheduler?

It has no built-in UI for configuration or monitoring, no useful and reasonably searchable logging or historical review, no support for multiple execution nodes, no administration interface, no alerts or notifications, not to mention buggy recovery mechanisms for failed jobs and missed jobs.

How do you trigger Quartz Scheduler?

All the Jobs registered in the Quartz Scheduler are uniquely identified by the JobKey which is composed of a name and group . You can fire the job which has a given JobKey immediately by calling triggerJob(JobKey jobKey) of your Scheduler instance. // Create a new Job JobKey jobKey = JobKey.

How do I start Quartz Scheduler in web application?

As a first step create a web application and keep all the Quartz Scheduler dependent jars in classpath. Put the quartz. properties and jobs XML file under classes folder. The configuration of the above job is defined in the job configuration XML file.

How do I run multiple jobs in Quartz Scheduler?

If you want to schedule multiple jobs in your console application you can simply call Scheduler. ScheduleJob (IScheduler) passing the job and the trigger you've previously created: IJobDetail firstJob = JobBuilder.


1 Answers

What am I missing here?

jta.jar

like image 179
Tomasz Nurkiewicz Avatar answered Sep 20 '22 09:09

Tomasz Nurkiewicz