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

java.lang.NullPointerException on MongoDBJobStore#shutdown #19

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi,

I used MongoDBJobStore through Spring (3.2.2.RELEASE) with a null jobstore hostname.

"mongo.close()" fails because "mongo" is null.

java.lang.NullPointerException at com.novemberain.quartz.mongodb.MongoDBJobStore.shutdown(MongoDBJobStore.java:91) at org.quartz.core.QuartzScheduler.shutdown(QuartzScheduler.java:714) at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1324) at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1484) at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:598) at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:479) at com.visionobjects.myscript.backend.common.scheduler.MyScriptBackendSchedulerFactoryBean.afterPropertiesSet(MyScriptBackendSchedulerFactoryBean.java:18) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:735) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1233) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:678) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:475) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90) at org.eclipse.jetty.server.Server.doStart(Server.java:270) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1260) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1183) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.jetty.start.Main.invokeMain(Main.java:462) at org.eclipse.jetty.start.Main.start(Main.java:610) at org.eclipse.jetty.start.Main.main(Main.java:86)

michaelklishin commented 11 years ago

What do you mean with null jobstore hostname? Does the mongodb driver support null hostnames?

ghost commented 11 years ago

There was a mispelling in my property name of the hostname, so JNDI injected a null string for org.quartz.jobStore.addresses

michaelklishin commented 11 years ago

1.2.0-beta1 is out with a fix

michaelklishin commented 11 years ago

1.2.0 is out with a fix