michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
249 stars 203 forks source link

Error in setting org.quartz.jobStore.mongoUri in quartz.properties #41

Closed vivganes closed 10 years ago

vivganes commented 10 years ago

I used the following quartz.properties file.

# Use the MongoDB store
org.quartz.jobStore.class=com.novemberain.quartz.mongodb.MongoDBJobStore
# MongoDB URI (optional if 'org.quartz.jobStore.addresses' is set)
org.quartz.jobStore.mongoUri=<<my Mongo URI?>>
# comma separated list of mongodb hosts/replica set seeds (optional if 'org.quartz.jobStore.mongoUri' is set)
#org.quartz.jobStore.addresses=localhost
org.quartz.jobStore.dbName=<<my db name>>
# Will be used to create collections like mycol_jobs, mycol_triggers, mycol_calendars, mycol_locks
org.quartz.jobStore.collectionPrefix=quartz
# thread count setting is ignored by the MongoDB store but Quartz requries it
org.quartz.threadPool.threadCount=10

I get the following exception during initialization of Quartz.

Stack trace:

Caused by: java.lang.NoSuchMethodException: No setter for property 'mongoUri' at org.quartz.impl.StdSchedulerFactory.setBeanProps(StdSchedulerFactory.java:1372) at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:848) ... 8 more

michaelklishin commented 10 years ago

There is a setter for mongoUri. What Quartz version do you use?

michaelklishin commented 10 years ago

Looking at Quartz source for 2.1.x and 2.2.0, the line that thrown an exception does not match what's in the stack trace posted.

vivganes commented 10 years ago

I am using "org.quartz-scheduler" % "quartz" % "2.1.5"

vivganes commented 10 years ago

I see the exception code here : http://grepcode.com/file/repo1.maven.org/maven2/org.quartz-scheduler/quartz/2.1.5/org/quartz/impl/StdSchedulerFactory.java#1372

vivganes commented 10 years ago

Also, i am using "com.novemberain" % "quartz-mongodb" % "1.3.0-beta2" with resolver resolvers += "Clojars Repository for quartz-mongodb" at "http://clojars.org/repo",

vivganes commented 10 years ago

I was using old and beta jars of quartz-mongodb. I changed to 1.3.0 and the error is gone :)

Closing this issue.