org.quartz.SchedulerConfigException: DataSource name not set.

Spring JIRA | Néstor de Jesus Boscán Bujanda | 1 decade ago
  1. 0

    I'm trying to use a Spring Quartz configuration to use a JobStoreTX job store and a Spring managed dataSource. Using the "dataSource" property the Scheduler job store class is automatically set to JobStoreCMT. If you use the "nonTransactionalDataSource" property you get the following exception: org.quartz.SchedulerConfigException: DataSource name not set. at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:470) at org.quartz.impl.jdbcjobstore.JobStoreTX.initialize(JobStoreTX.java:70) at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1010) at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1152) at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:604) at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:509) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:50) The only way to configure the scheduler with JobStoreTx is to set it using the quartz properties like this: <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="quartzProperties"> <props> <prop key="org.quartz.jobStore.isClustered">false</prop> <prop key="org.quartz.scheduler.instanceId">AUTO</prop> <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop> <prop key="org.quartz.jobStore.tablePrefix">T_QRTZ_</prop> <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.oracle.OracleDelegate</prop> <prop key="org.quartz.jobStore.selectWithLockSQL">SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME= ?</prop> <prop key="org.quartz.jobStore.useProperties">true</prop> <prop key="org.quartz.dataSource.whatever.jndiURL">jdbc/WhateverDs</prop> <prop key="org.quartz.jobStore.dataSource">whatever</prop> </props> </property> But in this case you can't use a spring managed data source.

    Spring JIRA | 1 decade ago | Néstor de Jesus Boscán Bujanda
    org.quartz.SchedulerConfigException: DataSource name not set.
  2. 0

    I'm trying to use a Spring Quartz configuration to use a JobStoreTX job store and a Spring managed dataSource. Using the "dataSource" property the Scheduler job store class is automatically set to JobStoreCMT. If you use the "nonTransactionalDataSource" property you get the following exception: org.quartz.SchedulerConfigException: DataSource name not set. at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:470) at org.quartz.impl.jdbcjobstore.JobStoreTX.initialize(JobStoreTX.java:70) at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1010) at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1152) at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:604) at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:509) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:50) The only way to configure the scheduler with JobStoreTx is to set it using the quartz properties like this: <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="quartzProperties"> <props> <prop key="org.quartz.jobStore.isClustered">false</prop> <prop key="org.quartz.scheduler.instanceId">AUTO</prop> <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop> <prop key="org.quartz.jobStore.tablePrefix">T_QRTZ_</prop> <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.oracle.OracleDelegate</prop> <prop key="org.quartz.jobStore.selectWithLockSQL">SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME= ?</prop> <prop key="org.quartz.jobStore.useProperties">true</prop> <prop key="org.quartz.dataSource.whatever.jndiURL">jdbc/WhateverDs</prop> <prop key="org.quartz.jobStore.dataSource">whatever</prop> </props> </property> But in this case you can't use a spring managed data source.

    Spring JIRA | 1 decade ago | Néstor de Jesus Boscán Bujanda
    org.quartz.SchedulerConfigException: DataSource name not set.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    GitHub comment 2#106726993

    GitHub | 2 years ago | dtamm
    org.quartz.SchedulerConfigException: DataSource name not set.
  5. 0

    Wildfly 9 - Probleme excluding Quartz dependency

    Stack Overflow | 6 months ago | user3029642
    org.quartz.SchedulerConfigException: Unable to instantiate InstanceIdGenerator class: org.quartz.simpl.SimpleInstanceIdGenerator cannot be cast to org.quartz.spi.InstanceIdGenerator [See nested exception: java.lang.ClassCastException: org.quartz.simpl.SimpleInstanceIdGenerator cannot be cast to org.quartz.spi.InstanceIdGenerator]

    3 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.quartz.SchedulerConfigException

      DataSource name not set.

      at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize()
    2. quartz
      StdSchedulerFactory.getScheduler
      1. org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:470)
      2. org.quartz.impl.jdbcjobstore.JobStoreTX.initialize(JobStoreTX.java:70)
      3. org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1010)
      4. org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1152)
      4 frames
    3. Spring Context Support
      SchedulerFactoryBean.afterPropertiesSet
      1. org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:604)
      2. org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:509)
      2 frames
    4. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
      3. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
      5. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
      5 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
      1 frame
    6. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
      2. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:252)
      3. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
      4. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:50)
      4 frames