Undeployment timer task

I have a Timer class that performs a TimerTask periodically, however even after undeployment of the application the tasks continues to be performed. How can I solve this problem?
I also noticed that when I undeploy my application, the number of classes doesn't decrease. Moreover when I redeploy the application the number of classes increases again.

@sarat
Look at the API doc of Timer....
http://java.sun.com/j2se//1.4.2/docs/api/java/util/Timer.html
Look at the 2nd paragraph <thanx ejp>
>
Corresponding to each Timer object is a single background thread that is used to execute all of the timer's tasks, sequentially. Timer tasks should complete quickly. If a timer task takes excessive time to complete, it "hogs" the timer's task execution thread. This can, in turn, delay the execution of subsequent tasks, which may "bunch up" and execute in rapid succession when (and if) the offending task finally completes.
If you still don't understand it... Hmm.... Words fail me!!!!!!

Similar Messages

  • Timer Task Mysteriously exiting.

    Hello I have a server up and running and it has some timer tasks which was started by the following command:
    timer = new Timer(false);
    timer.schedule(myTimerClass, 1200, 1200);
    This task has been running fine for years, but now sometimes appearingly at random it would all of a sudden without any exceptions stop ( so the logs are no help! ). ( which resulted in me suddenly finding a lot of data not being processed )...... it would not start up again until I restarted the application.
    I am having a very hard time to know how to even begin to analyze this error. I cannot run any analyze tools in production server where it happens. However I have access to test environment... but I am unable to recreate it there.
    Does anyone have any clue how I could even begin to analyze this? or did anyone have a simular problem with timers ?? Other timer tasks by the same timer was still running!!!
    Regards,
    Dak

    It is just like this I do not own the prod machine so it is not my rules...
    I think I got what happens after some more investigation though! I think that some very special condition causes the timer task to not finish running, and after looking at some source code of timer... if it does not get a proper "signal" that the timer task finished, it would keep waiting forever for it to finish without starting a new timer taks. Without any messages or exception.
    So this must be what happens, now all I need to do is to figure out why the timer task hanged without finishing. Maybe a deadlock or infite while?? or siimiliar?
    Thank you for your advice kajbj!
    Dak.

  • Xi real time tasks

    Hi Xi Guru's!
    I need any technical specification in xi as i have done basic scenarios, I want know how the real time objects will be in Xi, could any one send me the real time tasks spec or objects, So that it will be more help full to me to get acquainted with real time tasks.
    Thank you guru's,
    Mark...
    [email protected]

    Markiv,
    Check this weblog for all the documents in XI:
    /people/michal.krawczyk2/blog/2005/04/09/xi--saps-document-templates
    Regards,
    ---Satish

  • Synchronizing the read of two timer tasks (Period and Two Edge Separation)

    Hello,
    I am using labview 2011 and need to latch the data from two timer tasks of a 6602 board at the same time and then perform the read. One task is a period measurement the other is a two edge speration.  It sounds pretty simple and I am sure it is, I just haven't located the correct information yet,  If someone would point point me in the correct direction.
    Thanks,
    Mike

    While it's true that a digital edge arm start trigger can help to sync the tasks to begin together, the nature of the measurements you're making also have a big impact on whether you can depend on the buffered data remaining "synced."   Both measurement types will latch measurement data at times determined by the signal(s) being characterized.  You cannot configure either task type to sample at a known constant rate.  You can only accept samples at the rate dictated by the signals' own edges.
    Ok, so having said all that, here are some implications:
    1. a cumulative sum of all your period data will effectively give you timestamps for all the active edges, with t=0 set by the arm start trigger edge.
    2. there is no information inherent in a two edge separation measurement that can identify the time relative to the arm start trigger.  You'll get a bunch of measured interval times with completely unknown times between those intervals
    3. caveat: if you are somehow using the same signal edge for both measurements AND getting one measurement of two-edge separation for each and every period measurement, ONLY then would you be able to reconstruct the timestamps relative to the arm start trigger edge.
    So I'd caution you that the idea of latching readings in sync or reconstructing relative edge times between the measurements is pretty unlikely to work except under some very specific circumstances.
    -Kevin P

  • Need help on Task Scheduling  using Timer task

    Hi all,
    Does any body know how to schedule a task at any given time using Timertask. Say i want to execute a task at 4:00 AM. but the timer task is executing the task at 4:00 AM and as well as at 4:00 PM also. But i don't want to execute the task at 4:00 PM. So how to specify the start time exactly as 4:00 AM only. How to specify the exact start time for timer task . please refer the following code how i have implemented
    Looking for any kind of help or hints or suggestions.
    Thanks in advance
    Date startTime = getExecutionTime(4,0);
    timer=new java.util.Timer();
    ImportingTask task = new ImportingTask();
    timer.scheduleAtFixedRate(task,startTime,interval);
    private Date getExecutionTime(int hours,int minutes ){
    GregorianCalendar present_Cal = new GregorianCalendar();
    GregorianCalendar result = new GregorianCalendar(
    present_Cal.get(Calendar.YEAR),
    present_Cal.get(Calendar.MONTH),
    present_Cal.get(Calendar.DATE),
    hours,
    minutes );
    return result ;
    class ImportingTask extends TimerTask{
    public void run(){
    executeScheduledJob();
    }

    I also have a similar problem.
    I used timer.scheduledAtFixedRate(MyTimerTask, start date, period). The start date is today 6:00AM and the period is 24 hours. It works fine. My problem is that I would like the user to enter a specific number of minutes or hours before it should start again.
    The current program starts initially at 6:00AM then it stops after 24 hours (which is 6:00AM the next day) and runs again.
    What I would like is that after 24 hours, the user can input, say, 5 mins......thus, the program should run at 6:05AM. Then it should run again at 6:10AM the next day and so forth.
    Can scheduledAtFixedRate handle this? Thanks in advance!

  • Urgent---Timer and timer tasks

    Hi ,
    I need to poll some devices on the network...
    I have a method exposed in my class for this purpose.
    I have a timer and a timer task to do this job for me at regular intervals..
    I understand that the timer will spawn a separate thread for this purpose..But if there are multiple requests fot the poll,then each request will spawn off a new thread as i have understood...
    Wont it clog the system with too many threads?
    How do i acheive this task?Is there any other alternative?
    Please help....
    Regards

    Additionally, if you start a timer and can't reuse it, for whatever reason, you ought to stop it and free its resources in order to not clog up the system. Does the spawned thread run on, or does it stop after returning? Maybe the system isn't clogged up after all?

  • How to diagnose slow undeployment times

    Over on the JDev forum I recently posted the following thread: Re: 11.1.2 - app redeployment/undeployment times poor to integrated WLS
    Essentially under the latest JDev 11.1.2 I've detected that undeployment from the integrated WLS is unreasonably slow on my MacBookPro.
    I've lodged an SR with Oracle Support who want to attempt to replicate the problem, but don't have a Mac to do so (which all seems kinda pointless). As such to speed the process up I figure I need to get more diagnostics out of WLS while it's actually doing the undeployment of the application, to supply support.
    This is where I'm at a loss, given the huge amount of WLS documentation, I'm not sure where to find this. Is it possible to turn on diagnostics during the undeployment of an application from WLS, and if possible so I know where to look in the docs myself in the future, is there any documentation on describing how to do this please?
    Thanks for your time.
    CM.

    Chris,
    You might try turning on the DEBUG in the console for the deployment. Server->Debug->weblogic->deploy
    http://dl.dropbox.com/u/26835239/deploymentDebug.png
    The look in your DOMAIN_HOME\servers\SERVER_NAME\logs\SERVERNAME.log
    You might also try taking some thread dumps and seeing what's going on.

  • Record Working Time task merging multiple employees into a single task

    Hi Everyone,
    I'm going to check our configuration again to see if this is standard behaviour, config, or a problem with EHP 3's version of record working time.
    So if employee A submits to manager A 1 task is created.  Then when employee B submits to manager A we were expecting 2 tasks.  However, we've been noticing manager A is getting 1 task with several line times. 
    We are ok with it merging tasks for employee A over multiple weeks.  That is ideal actually.
    The problem is that employee B's task should be separate.
    Is there a quick fix?
    Thanks,
    Doug Robbins

    I did try 31000007 and noticed the same behavior.  Are you saying I should use an older version of the task to get back to grouped by employee number and not merging everything? 
    Well this causing us issues for a few reasons. The main one we developed a work around because we had to make sure emails were not being sent to 1 person for all the employees with their data.  That would cause obvious security concerns. 
    But when forward tasks out managers want to be able to forward a specific employee's requests and not all of them.  If some customers want this it should be a configurable option.  To allow companies that want 1 single task or companies that want 1 task/employee/week.
    This is inconsistent with the other portal applications.  It would be nice if Germany picked 1 way of doing things or provided more configuration options.  I'm hoping that OSS gives us something because merging everything into a single task for all employees is not the behaviour we want or expected.
    I always appreciate your input because you have been very helpful as I learn about portal.
    Thanks,
    Doug R
    Thanks you

  • How to synchronized two Timer Task ?

    I need to execute 2 job
    job1 every sec
    job2 every min
    when one task is executing other task should wait
    so i created 2 timer
    timer1 will execute secjob every sec
    timer2 will execute minjob every min
    and one job object with synchronized execute method
    please see the code for further detail
    problem:
    before completion of secjob , minjob started excuting
    job Fired Fri Oct 10 20:45:16 IST 2008 by Timer-0 ID :7.....
    job Fired Fri Oct 10 20:45:21 IST 2008 by Timer-0 ID :7.....
    job Fired Fri Oct 10 20:45:26 IST 2008 by Timer-0 ID :7....{color:#ff0000}*job Fired Fri Oct 10 20:45:31 IST 2008 by Timer-1 ID :8*{color}*.*
    {color:#ff0000}*...*{color}
    job Fired Fri Oct 10 20:45:34 IST 2008 by Timer-0 ID :7.....
    job Fired Fri Oct 10 20:45:39 IST 2008 by Timer-0 ID :7.....
    public class Fire {
        static void secJob(Job job)  {
             Timer timer = new Timer();
             int delay = 0;  
             int period = 1000*1; 
             SecJob secJob = new SecJob(job);
             timer.schedule(secJob, delay, period);        
        static void minJob(Job job) {
             Timer timer = new Timer();
             int delay = 0;  
             int period = 1000*60; 
             MinJob minJob = new MinJob(job);
             timer.schedule(minJob, delay, period);
        public static void main(String[] args) {       
            final Job job = new Job();
            secJob(job);
            minJob(job);
    public class SecJob extends TimerTask{
        Job job;
        public SecJob(Job job) {
            this.job = job;
        public void run() {
            job.execute(SecJob.class);
    public class MinJob extends TimerTask{
        Job job;
        public MinJob(Job job) {
            this.job = job;
        public void run() {
            job.execute(MinJob.class);   
    public class Job {
        private void sleep(long count,PrintStream out) {
            try {
                for (int i = 0; i < count; i++) {
                    Thread.sleep(1000*1);
                    out.print(".");
                out.println();
            } catch (InterruptedException e) {
                e.printStackTrace();
        public synchronized void execute(Class c) {
            Thread t = Thread.currentThread();
            if(c == MinJob.class ) {
                System.err.print("job Fired "+new Date()+" by "+t.getName()+" ID :"+t.getId());
                sleep(3,System.err);
            }else if(c == SecJob.class ) {
                System.out.print("job Fired "+new Date()+" by "+t.getName()+" ID :"+t.getId());
                sleep(5,System.out);

    I'd only use one timer and write a dispatcher task that stores the time at which job2 is executed. If the last time is more than one minute past, execute job1, reset the time tracking field, and execute job2.

  • Approval of Working Times tasks show in UWL and shouldn't

    Our employees use ESS to record their working time and the managers use MSS to approve that time.  Occasionally the task Approval of Working Times, along with the sender date, name and a Cats attachment, appears in the managers UWL which makes it look like someone has time to be approved however, we do not go to the UWL to approve time.  If this task is clicked on in the UWL a u201CService cannot be reached HTTP 404 u2013 Not foundu201D error is thrown.  The send date of this task does correspond with a date when the employee entered time in ESS which the manager approved a few days later in MSS.  So it appears that occasionally but not regularly or in any sort of pattern, time workflows to both MSS where the managers approve it and to the UWL where we donu2019t want it and sits there and drives the managers crazy.  (Managers do go to the UWL to approve PCRs.)  We have checked the workflow log and cannot see a split.  How do we prevent the time approval from routing to the UWL?

    Hi,
    For me it seems that the the workflow should be turned off. There are ways to disable tasks from UWL, etc. (to not show them), but I would definately take a look to the CATS configurations in SPRO (unfortunately I don't remember the exact path, but it should not be too difficult to find). Basically there is place where you define that which workflow task is send to the manager when the employee releases the timesheet. You can perhaps remove this task from the configuration or perhaps there is some checkbox or something where you can turn of the workflow or whatever. Take look to this first. If you have CATS/HR people on your site, they will probably know what I am talking about.
    Another perhaps good option could be that you do certain configurations for UWL and then the CATS approval application is opened when the managers click the item in UWL -. but I would first try to prevent the work item to be sent to the workflow at all, if it should not be sent there at the first place.
    Regards,
    Karri

  • Use Timer Task to run a loop at a certain time

    import java.util.*;
    class Run30Sec {
    public static void main( String args[] )
    int numberOfMillisecondsInTheFuture = 10000; // 10 sec
    Date timeToRun = new Date(System.currentTimeMillis()+numberOfMillisecondsInTheFuture);
    Timer timer = new Timer();
    timer.schedule(new TimerTask() {
    public void run() {
    // Task here ...
    for (; ;;) {
    System.out.println("Run 10 secs");
    }, timeToRun);
    }

    It starts after ten seconds delay and runs for five seconds.
    import java.util.*;
    class Run5Sec {
      static boolean go = true;
      public static void main( String args[] ){
        int numberOfMillisecondsInTheFuture = 10000; // 10 sec
        // you could use schedule(TimerTask task, long delay)
        // instead of Date
        Date timeToRun
          = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture);
        Timer timer = new Timer();
        timer.schedule(new TimerTask(){
          public void run(){
            Timer ttimer = new Timer();
            ttimer.schedule(new TimerTask(){
              public void run(){
                go = false;
            }, 5000); // exit the timer after five seconds
            while (go) {
              System.out.println("I will run only for 5 secs.");
            System.exit(0);
        }, timeToRun);
    }

  • Real time task synchronization

    I am using LabVIEW real time and I want to "trigger" a lower priority task at the end of the highest priority task if it isn't already done. What is the best solution ? I have read somewhere on NI site that the synchronisation palette doesn't guarantee determinism but unfortunately the real time fifos do not provide a blocking read call. Is there a potential real time problem when using occurences ? I would just like a simple deterministic mechanism to wake up a task if it isn't already awake.
    Thanks in advance.

    Monsieur,
    Je vous invite à consulter la doc ci-dessous pour plus d'infos sur comment LabVIEW gère les priorités lorsque plusieurs VIs s'exécutent en parallèle.
    * How Does Priority Affect the Execution of VIs?
    http://digital.ni.com/public.nsf/websearch/84081F249CEF7AB7862569450074168C?OpenDocument
    * How is Priority of Execution Assigned when Loading and Executing Multiple VIs in LabVIEW?
    http://digital.ni.com/public.nsf/websearch/44AB5BEDC20CB43C862565D4000D9885?OpenDocument
    Les RT FIFOs sont le meilleur moyen pour transférer des données entre threads (typiquement, un thread critique avec un thread normal ou lower).
    Les RT FIFOs ne cassent pas le déterminisme d'une application RT contrairement aux variables locales ou globales.
    La gestion de l'exécution est entièrement faite par le Scheduler du moteur LabVIEW RT. Vous n'avez pas le contrôle sur son mode de fonctionnement.
    Vous n'avez pas du tout intérêt à synchroniser avec les outils de LabVIEW une tâche critique RT avec une tâche non critique car vous allez forcément casser le déterminisme de l'application RT. Vous pouvez cependant synchroniser des portions de code du VI non critique (occurence pour déclencher du code sur génération d'un événement logiciel, rendez-vous pour synchro démarrage multi-VIs, sémaphores ...).
    Cordialement.
    Matthieu Gourssies
    National Instruments

  • Speeding up deploy and undeploy time

    Is there anyway to speed up the amount of time that it takes to deploy and
    undeploy an EAR file? We are deploying about 45 EJB in a EAR module and it
    take over 30 min for the process. If we find problems and need to undeploy
    and then deploy again, it is an overly time consuming process.
    Best Regards
    Suneet Shah
    Diamelle Technologies http://www.diamelletechnologies.com
    Cortlandt Manor, NY Dev Center: Bombay India
    Office: 914 739 4386 - Cell: (914) 837-0046
    -----------------------

    Hi Suneet.
    There really is no need to redeploy an app unless changes are made to deployment
    descriptors. Classfiles are extracted to install_dir/ias6/ias/APPS (the
    directory structure is pretty straightforward). You can replace classfiles
    directly and restart the server.
    The packaging article at
    http://developer.iplanet.com/docs/articles/packaging/packaging.jsp explains
    this in greater detail.
    Thx,
    - deepak
    Suneet Shah wrote:
    Is there anyway to speed up the amount of time that it takes to deploy and
    undeploy an EAR file? We are deploying about 45 EJB in a EAR module and it
    take over 30 min for the process. If we find problems and need to undeploy
    and then deploy again, it is an overly time consuming process.
    Best Regards
    Suneet Shah
    Diamelle Technologies http://www.diamelletechnologies.com
    Cortlandt Manor, NY Dev Center: Bombay India
    Office: 914 739 4386 - Cell: (914) 837-0046

  • Timer task freezes !?!?!?

    Dear all,
    I previously made a module that act as timer for sleeping for some time & then wakes up to do something, I used Thread.sleep( ... ) in order to implement. I debugged this module and I pass correct value for sleeping to Thread.sleep, but sometimes -- randomly -- I find that the my application is not working after sleeping the specified period!!!!
    So I searched in Java for a class that impleemnt this and I found java.util.Timer, java.util.TimerTask in JDK 1.3 ==> so I changed my code to use this two classes and began to make my tests, I downloaded jdk 1.3.1 and I began to run 5 instances of my application in different times and I keep monitoring their behavoiur it was working just fine -- The application start running when it is called and then scheduled to run every 30 seconds -- until after 6 dayes one of the five instances freezed and didn't continue, the other 4 instances till now are working fine.
    By Freezing I mean that my application -- run on command line -- stoppes displaying my System.out.println( ) in each time they start and end.
    I'm very confused about what is happening, specially it occures on my customer machine, and there are other jobs that use the my old technique are running just fine for more than monthes.

    I used the ctrl-break and the following was written on the screen then the freezed application continued again:
    "Thread-1" prio=5 tid=0x234930 nid=0x430 waiting on monitor [0..0x6fb30]
    "Thread-0" prio=5 tid=0x82a178 nid=0xa34 runnable [0x8d9f000..0x8d9fdbc]
    at java.io.Writer.write(Writer.java:129)
    at java.io.BufferedWriter.newLine(BufferedWriter.java:222)
    at java.io.PrintStream.newLine(PrintStream.java:286)
    at java.io.PrintStream.println(PrintStream.java:550)
    at com.mega.vi.robot.AlertingRobot.run(AlertingRobot.java:91)
    at java.util.TimerThread.mainLoop(Timer.java:435)
    at java.util.TimerThread.run(Timer.java:385)
    "Signal Dispatcher" daemon prio=10 tid=0x8109d0 nid=0x9b4 waiting on monitor [0.
    .0]
    "Finalizer" daemon prio=9 tid=0x80caf8 nid=0xa38 waiting on monitor [0x8c5f000..
    0x8c5fdbc]
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162)
    "Reference Handler" daemon prio=10 tid=0x89a0368 nid=0x754 waiting on monitor [0
    x8c1f000..0x8c1fdbc]
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:420)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)
    "VM Thread" prio=5 tid=0x8a0e1c0 nid=0x9a0 runnable
    "VM Periodic Task Thread" prio=10 tid=0x80f6d0 nid=0x654 waiting on monitor
    "Suspend Checker Thread" prio=10 tid=0x810020 nid=0x8a4 runnable
    sorry but I don't know much about threads, does the above dump give any indication about the problem.

  • Scheduling a timer task

    Hi,
    I have created a Repeattask which extends the timertask.In the run method of this i call the task to be processed.
    I have another class where i instantiate the Repeattask and call the run method to be scheduled.I use timer.schedule(task,time).
    The problem is that this task takes very long time to complete.So if the time interval is small this task is called again before the original task is finished.
    Is there a way to schedule the task again after the original task is completed.
    thanks
    jagath

    You should use one of the other two schedule methods in the Timer API:
    schedule(TimerTask,long,long) or schedule(TimerTask,Date,long)Both of these methods use fixed-delay timers which don't start until the previous execution finishes.
    See:
    http://java.sun.com/j2se/1.4/docs/api/java/util/Timer.html#schedule(java.util.TimerTask,%20long,%20long)

Maybe you are looking for

  • My macbook keeps losing wifi connection after restarting and I can't connect to my wifi in recovery mode

    I have two problems actually, which I think are connected. I installed a new hard drive and am in the process of returning my macbook pro to normal. I'm now using Mac OS X 10.6.8 and I want to be able to update to OS Lion. When my computer is on it c

  • Character set Conversion Buffer Overflow Error

    Hi, I have got an issue while loading data from a flat file to a staging table. i.e., Character set Conversion Buffer Overflow. Suppose there are 10,000 records in a flat file, after running control file only 100+ records are loading to the staging t

  • Not correct import of CS4 3D PhotoShop files into CS5.5

    On the default, when I open 3D PhotoShop file (created in CS4) The Environment texture of 3D object (created in CS4) has scale equal ZERO (instead 1, as it was in CS4). How it can be solved? Thanks.

  • Fast GUI development

    I have a project with many screens (views?). they interact with a data layer that gets data from different sources. I want to concentrate now on making the screen look better with styles, transitions etc. But loading the entire app everytime is slow.

  • Engine.security.facade

    In the Link:[CE document|http://help.sap.com/saphelp_nwce10/helpdata/en/44/0d5b8f250d5cfae10000000a155369/content.htm], it is said that the DC engine.security.facade in Software Component ENGFACADE is needed for DC dependency, but I cannot find engin