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

  • How to stop a spring scheduler thread ?

    Hi

    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 [java.lang.ThreadLocal@757fad]) 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:scheduled-tasks>

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

    <bean id="taskSchedulerClass" class="com.abc.efg.util.xyz">
    <property name="xmlName" value="xyz.xml" />
    </bean>
Working...
X