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
248 stars 203 forks source link

Getting following error #96

Closed arpitrajpurohit12 closed 9 years ago

arpitrajpurohit12 commented 9 years ago

I have set the properties as mentioned . But I am getting following error:

JobStore class 'com.novemberain.quartz.mongodb.MongoDBJobStore' props could not be configured.Exception in thread "main" java.lang.NullPointerException

michaelklishin commented 9 years ago

I cannot suggest anything from this 2 line trace. I have poor telepathic skills, so please post quartz.properties and stack trace next time.

arpitrajpurohit12 commented 9 years ago

Sorry for the incomplete info-

Following is quartz.properties :

org.quartz.jobStore.class=com.novemberain.quartz.mongodb.MongoDBJobStore org.quartz.jobStore.mongoUri=mongodb://localhost:27020 org.quartz.jobStore.dbName=quartz org.quartz.jobStore.collectionPrefix=mycol org.quartz.threadPool.threadCount=1 org.quartz.jobStore.isClustered = false

Following error I get :

JobStore class 'com.novemberain.quartz.mongodb.MongoDBJobStore' props could not be configured.Exception in thread "main" java.lang.NullPointerException.

"Its from line 883 of StdSchedulerFactory"

Following is the constructor :

public CScheduler() throws SchedulerException{
    properties=new Properties();

    InputStream stream= getClass().getClassLoader().getResourceAsStream(propertiesFile);
    try{
        properties.load(stream);
    }
    catch(Exception e)
    {
        System.out.println("Exception:"+e);
    }
   SchedulerFactory sf = new StdSchedulerFactory(properties);
   this.scheduler=sf.getScheduler();
}

.