Results 1 to 5 of 5
  1. #1
    srinivas9684 is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default ERROR: Timer already cancelled

    hi experts,

    As iam running the backgroundjob twice i.e.,. one after the other immediately, the first time it is executing the job successfully but before starting the next one it is showing error "Timer already cancelled" when iam using the singletontimer class extending the timertask

    code written by me:

    timer=SingaltonTimer.getSingletonTimerObject();
    uploadMaterialSchedularObj = new UploadMaterialSchedular (request,response,desc,filename,templatename,id,ci d,status); timer.scheduleAtFixedRate(uploadMaterialSchedularO bj,date.getTime(),1000);

    error at above line. please reply with solution..?
    Last edited by srinivas9684; 09-24-2009 at 08:46 AM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Did the previous run of your timer throw an exception?

  3. #3
    srinivas9684 is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default timer already cancelled

    hi toll,

    first time it is executed successfully, after finishing that second time to run the same timer it is failed then it is showing error.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Just wondering, because if an exception is thrown by the code in the timer thread then the timer will close itself, resulting in, I believe, the exception you're getting.

    Have you checked your logs for the stuff you're launching in the timer?

  5. #5
    srinivas9684 is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default timer already cancelled

    hi tolls,

    yah i have checked the log too but i dont find any error or exception.

    i need the second time job to be executed immediately after the first one is

    finished but it is not happening. need help.

Similar Threads

  1. Timer help
    By Kinyo in forum New To Java
    Replies: 15
    Last Post: 03-15-2009, 03:37 AM
  2. EJB Timer
    By mrjunsy in forum Advanced Java
    Replies: 0
    Last Post: 08-22-2008, 05:09 PM
  3. EJB Timer
    By mrjunsy in forum New To Java
    Replies: 0
    Last Post: 08-04-2008, 07:47 PM
  4. Replies: 0
    Last Post: 04-04-2008, 03:46 PM
  5. Page Timer
    By deeadeed in forum New To Java
    Replies: 0
    Last Post: 12-05-2007, 09:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •