Q: Cannot find class [org.springframework.scheduling.quartz.SchedulerFactoryBean] in Spring web app I'm trying to build a scheduler inside my web application in Spring. I use maven to deal with all the dependencies. I have put the following bean in my XML
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="configLocation" value="classpath:quartz.properties" />
</bean>

In the web.xml file I have the following (from a tutorial):
<context-param>
     <param-name>quartz:config-file</param-name>
     <param-value>quartz.properties</param-value>
 </context-param>
 <context-param>
     <param-name>quartz:shutdown-on-unload</param-name>
     <param-value>true</param-value>
 </context-param>
 <context-param>
     <param-name>quartz:wait-on-shutdown</param-name>
     <param-value>false</param-value>
 </context-param>
 <context-param>
     <param-name>quartz:start-scheduler-on-load</param-name>
     <param-value>true</param-value>
 </context-param>

While in my pom.xml I added again what a tutorial suggested
    <!-- Quartz API -->
    <dependency>
        <groupId>opensymphony</groupId>
        <artifactId>quartz</artifactId>
        <version>1.6.3</version>
    </dependency>

    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.directory.studio</groupId>
        <artifactId>org.apache.commons.logging</artifactId>
        <version>1.1.1</version>
    </dependency>

    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>2.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz-jobs</artifactId>
        <version>2.2.0</version>
    </dependency>

I also defined a quartz.properties file
org.quartz.plugin.jobInitializer.class = 
org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.fileNames = quartz_jobs.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
org.quartz.plugin.jobInitializer.scanInterval = 10
org.quartz.plugin.jobInitializer.wrapInUserTransaction = false
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool 

And of course my quartz_jobs.xml file:
<?xml version='1.0' encoding='utf-8'?>
<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.quartz- 
scheduler.org/xml/JobSchedulingData http://www.quartz- 
scheduler.org/xml/job_scheduling_data_1_8.xsd"
  version="1.8">

<schedule>
    <job>
        <name>myJob</name>
        <group>MYJOB_GROUP</group>

        <description>My job description</description>
        <job-class>com.blah.blah.myJob</job-class>

    </job>

    <trigger>
        <cron>
            <name>myTrigger</name>
            <group>MYTRIGGER_GROUP</group>
            <job-name>myJob</job-name>

            <job-group>MYJOB_GROUP</job-group>
            <!-- trigger every 5 seconds -->
            <cron-expression>0/5 * * * * ?</cron-expression>

        </cron>
    </trigger>
</schedule>


I then created a scheduler and a job class (basic tutorial-like classes). My issue is that when I run it I receive 3 errors:
2018-09-10 14:52:23,636 - ERROR - [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.scheduling.quartz.SchedulerFactoryBean] for bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined in class path resource ...

Sep 10, 2018 2:52:23 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.scheduling.quartz.SchedulerFactoryBean] for bean with name 
'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined in class path resource ...

Quartz Initializer Servlet loaded, initializing Scheduler...
Sep 10, 2018 2:52:23 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.quartz.ee.servlet.QuartzInitializerListener
java.lang.NoClassDefFoundError: javax/transaction/UserTransaction

After some more logging it says Quartz Scheduler successful shutdown.. I have NO idea of what is going on, I am not super confident of what I did because I don't really know Java spring and its configuration. Can anybody figure out what am I missing?
EDIT: the third error was solved by adding javax.transaction in my pom.xml
EDIT2: here is the complete stack trace:
2018-09-10 16:28:10,698 - ERROR - [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.scheduling.quartz.SchedulerFactoryBean] for bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined in class path resource [ctx-core/my.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.scheduling.quartz.SchedulerFactoryBean
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1278)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:575)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1347)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:913)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:617)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5017)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5531)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.springframework.scheduling.quartz.SchedulerFactoryBean
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1722)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:265)
        at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:419)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1270)
        ... 18 more
Sep 10, 2018 4:28:10 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.scheduling.quartz.SchedulerFactoryBean] for bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined in class path resource [ctx-core/my.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.scheduling.quartz.SchedulerFactoryBean
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1278)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:575)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1347)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:913)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:617)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5017)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5531)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.springframework.scheduling.quartz.SchedulerFactoryBean
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1722)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:265)
        at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:419)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1270)
        ... 18 more
Quartz Initializer Servlet loaded, initializing Scheduler...
2018-09-10 16:28:10,730 - INFO  - [org.quartz.core.SchedulerSignalerImpl] - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2018-09-10 16:28:10,730 - INFO  - [org.quartz.core.QuartzScheduler] - Quartz Scheduler v.1.6.3 created.
2018-09-10 16:28:10,730 - INFO  - [org.quartz.simpl.RAMJobStore] - RAMJobStore initialized.
2018-09-10 16:28:10,730 - INFO  - [org.quartz.impl.StdSchedulerFactory] - Quartz scheduler 'QuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
2018-09-10 16:28:10,730 - INFO  - [org.quartz.impl.StdSchedulerFactory] - Quartz scheduler version: 1.6.3
2018-09-10 16:28:10,730 - INFO  - [org.quartz.core.QuartzScheduler] - Scheduler QuartzScheduler_$_NON_CLUSTERED started.
Scheduler has been started...
Storing the Quartz Scheduler Factory in the servlet context at key: org.quartz.impl.StdSchedulerFactory.KEY
Sep 10, 2018 4:28:10 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
Sep 10, 2018 4:28:10 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/myproject] startup failed due to previous errors
2018-09-10 16:28:10,734 - INFO  - [org.quartz.core.QuartzScheduler] - Scheduler QuartzScheduler_$_NON_CLUSTERED shutting down.
2018-09-10 16:28:10,734 - INFO  - [org.quartz.core.QuartzScheduler] - Scheduler QuartzScheduler_$_NON_CLUSTERED paused.
2018-09-10 16:28:10,734 - INFO  - [org.quartz.core.QuartzScheduler] - Scheduler QuartzScheduler_$_NON_CLUSTERED shutdown complete.
Quartz Scheduler successful shutdown.


A: you miss the javax.trasaction API in your classpath as the message says:
java.lang.NoClassDefFoundError: javax/transaction/UserTransaction

Add
<!-- https://mvnrepository.com/artifact/javax.transaction/javax.transaction-api -->
<dependency>
    <groupId>javax.transaction</groupId>
    <artifactId>javax.transaction-api</artifactId>
    <version>1.3</version>
</dependency>

as dependency and the exception should be solved.
The other problem is the missing class org.springframework.scheduling.quartz.SchedulerFactoryBean
Add also
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>${spring.version}</version>
</dependency>

