Announcement Announcement Module
No announcement yet.
How to stop a spring scheduler thread ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to stop a spring scheduler thread ?


    I have used spring scheduler to run methods using a cron timer as shown below . The application has atleast 50 scheduler beans of the same class mentioned in red color below. We create new beans by passing configuration parameters through an xml given in the property section. But we get an error from tomcat 6.0.36 which is shown as the underlined text below. Is this an issue , is there any way to overcome this error. If we add a lot of scheduled tasks as given below , will this not affect the application performance?

    SEVERE: The web application [/App ] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [[email protected]]) and a value of type [org.mozilla.javascript.Context[]] (value [[Lorg.mozilla.javascript.Context;@18e915a]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.

    <task:scheduled-tasks scheduler="myScheduler">
    <task:scheduled ref="taskSchedulerClass" method="callScheduler" cron="0 0/4 * * * *"/>

    <task:scheduler id="myScheduler" pool-size="10"/>

    <bean id="taskSchedulerClass" class="">
    <property name="xmlName" value="xyz.xml" />