Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4242956
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:30:46+00:00 2026-05-21T03:30:46+00:00

I have configured some schedulers in spring.When i try to start my web application

  • 0

I have configured some schedulers in spring.When i try to start my web application it throws following error and stops.My application is not actually started.My scheduler looks something like this also when i shut down tomcat some quartz thread are not shut down

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" destroy-method="destroy">
    <property name="triggers">
        <list>
           <ref bean="scheduler.localAdaptorCronTrigger"/>
        </list>
    </property>
</bean>   

<bean id="localAdaptor" class="LocalAdaptor" />

<bean id="scheduler.localFSSlaAdaptorJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="Adaptor"/>
        <property name="targetMethod" value="xxxxxx"/>
</bean>

<bean id="scheduler.localAdaptorCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="scheduler.localAdaptorJobDetail"/>
        <!-- run every morning at 12 AM -->
      <property name="cronExpression" value="0 0 0 * * ?"/>
    </bean>
    <bean id="scheduler.localFSSlaAdaptorSimpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
        <!-- see the example of method invoking job above -->
        <property name="jobDetail" ref="scheduler.localAdaptorJobDetail"/>
        <!-- runs after 10 seconds for single time...-->
        <property name="startDelay" value="1000"/>
        <!-- repeated once -->
        <property name="repeatCount" value="0"/>
        <!-- useless as the repeat count is 0, so it will run once after 10 seconds of the startup of the application.... -->
        <property name="repeatInterval" value="60000"/>
</bean>

Stacktrace:

INFO: Closing Spring root WebApplicationContext
Mar 31, 2011 10:02:22 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Mar 31, 2011 10:02:22 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Mar 31, 2011 10:02:22 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] but has failed to stop it. This is very likely to create a memory leak.
Mar 31, 2011 10:02:22 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/c] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] but has failed to stop it. This is very likely to create a memory leak.
Mar 31, 2011 10:02:22 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] but has failed to stop it. This is very likely to create a memory leak.
Mar 31, 2011 10:02:22 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@71ee88dd]) and a value of type [org.apache.cxf.bus.CXFBusImpl] (value [org.apache.cxf.bus.CXFBusImpl@409468ca]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.

I implemented listener:

import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 import org.quartz.SchedulerException;
 import org.quartz.impl.StdSchedulerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;


 public class QuartzServletContextListener implements ServletContextListener {

     final Logger log = LoggerFactory.getLogger(QuartzServletContextListener.class);
     public static final String QUARTZ_FACTORY_KEY =
             "org.quartz.impl.StdSchedulerFactory.KEY";
     private ServletContext ctx = null;
     private StdSchedulerFactory factory = null;

     public void contextInitialized(ServletContextEvent sce) {
         ctx = sce.getServletContext();

         try {

             factory = new StdSchedulerFactory();

             // Start the scheduler now

             factory.getScheduler().start();

             log.info("Storing QuartzScheduler Factory at"
                     + QUARTZ_FACTORY_KEY);

             ctx.setAttribute(QUARTZ_FACTORY_KEY, factory);

         } catch (Exception ex) {
             log.error("Quartz failed to initialize", ex);
         }
     }

     public void contextDestroyed(ServletContextEvent sce) {
         try {

             log.info("shutting down");
             factory.getScheduler().shutdown();
             Thread.sleep(1000);
         } catch (InterruptedException ex) {
             log.error("Quartz failed to shutdown", ex);
         } catch (SchedulerException ex) {
             log.error("Quartz failed to shutdown", ex);
         }
     }
 }

And added in web.xml

<listener>
        <listener-class>xx.yy.QuartzServletContextListener</listener-class>
    </listener>

When I try to use shutdown.sh I can se still some threads active and tomcat java process active .

Also to mention I have some 3 to 4 schedulers for different job as mentioned above in application context.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:30:46+00:00Added an answer on May 21, 2026 at 3:30 am

    As for any Quartz-related resources being reported by Tomcat, this is due to Tomcat being a bit over-eager at looking for non-freed resources when Quartz takes more than a few milliseconds to shutdown its resources.

    See discussion here (along with a simple work-around):

    http://forums.terracotta.org/forums/posts/list/3479.page

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a account page configured like the following; if(!isset($_SESSION[myusername])){ then show some login
I have the following situation. I have some IP phones configured and registered in
I have configured my web application to run under windows authentication mode, I also
In a Spring web application I have several DAO and service layer beans. One
I have a class library project which contains some content files configured with the
I think I've configured Box2d to have some sort of maximum velocity for any
I have configured my application to use form based authentication and set up the
I have configured my Web.Config file as follow in a ASP.NET MVC 2 project:
I have configured a SMTP appender to send an email whenever there's an error.
We have configured iReport to generate the following graph: The real data points are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.