Contiunous running programs: Thread.sleep vs. Scheduled Tasks

Hello,
I have simulation programs that should run continuously for weeks at a time. I am seeking any advice or comments on the best way to do something like this.
Some programs run every 30 seconds; others run once per hour; others run once per day. These programs involve simulating the use of a popular website by reading web pages and inserting records into Oracle 9i databases.
As far as the "every 30 seconds" program, I use Thread.sleep to pause the program for each interval. Is this a good method?
What about programs running once per hour or per day? I have used the Windows XP Scheduled Task program to execute the program. Is this a good method?
Does anybody know of a better way to do such things?
Any comments or helpful links are greatly appreciated.
Thank you,
Logan

I have simulation programs that should run
continuously for weeks at a time. I am seeking any
advice or comments on the best way to do something
like this.If you have a simulator, does it have to simulate time on a one to one basis. Could it not simulate 30 seconds, every 3 seconds and thus not need to run for the full week. If you have to run in real time, what are you simulating.
Some programs run every 30 seconds; others run once
per hour; others run once per day. These programs
involve simulating the use of a popular website by
reading web pages and inserting records into Oracle
9i databases.
As far as the "every 30 seconds" program, I use
Thread.sleep to pause the program for each interval.
Is this a good method?No. Sleep for 30 seconds just means there is atleast 30 seconds delay from the end of the last task to the start of the next task. This could means every 30.1 seconds or even every 33 seconds depending on how long the task takes to run.
If you create a single ScheduledExecutorService you can run a task with any period you suggest with a dynamic number of threads.
e.g.
Execuotrs.newScheduledThreadPool(1);
>
What about programs running once per hour or per day?See previous.
I have used the Windows XP Scheduled Task program to
execute the program. Is this a good method?If it is a couple of times per day or per week this is a good choice.
>
Does anybody know of a better way to do such things?see previous.

Similar Messages

  • Problem while running AD org lookup recon scheduled task

    Hi,
    I'm getting errors thrown when trying to run the AD org lookup recon scheduled task.
    using OIM 9.1.0.1 with the latest AD connector on JBoss.
    the error log -
    2009-10-21 16:00:01,399 DEBUG http://OIMCP.ADCS com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController : connectToAvailableAD:: FINISHED
    2009-10-21 16:00:01,399 DEBUG http://OIMCP.ADCS com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController : disconnect:: STARTED
    2009-10-21 16:00:01,414 DEBUG http://OIMCP.ADCS com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController : disconnect:: FINISHED
    2009-10-21 16:00:01,430 ERROR STDERR Exception in thread "DefaultQuartzScheduler_Worker-7"
    2009-10-21 16:00:01,461 ERROR STDERR java.lang.NoClassDefFoundError: com/sun/jndi/ldap/ctl/PagedResultsControl
    2009-10-21 16:00:01,461 ERROR STDERR at com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController.searchResultPageEnum(Unknown Source)
    2009-10-21 16:00:01,461 ERROR STDERR at com.thortech.xl.schedule.tasks.ADLookupReconTask.performReconciliation(Unknown Source)
    Can any one please help me ?
    Thanks

    Hi,
    Have placed ldapbp.jar in the Third Party Folde of OIM_Home Directory ?
    if not just add it and also add in the class path and the try.
    regards

  • Problem running AD Organization Lookup Recon scheduled task

    Hey all,
    I'm getting errors thrown in JBoss when trying to run the AD org lookup recon scheduled task.
    Running OIM 9.1.0.1 with the latest AD connector.
    here is the error JBoss is throwing...
    2009-10-21 16:00:01,399 DEBUG [OIMCP.ADCS] com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController : connectToAvailableAD:: FINISHED
    2009-10-21 16:00:01,399 DEBUG [OIMCP.ADCS] com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController : disconnect:: STARTED
    2009-10-21 16:00:01,414 DEBUG [OIMCP.ADCS] com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController : disconnect:: FINISHED
    2009-10-21 16:00:01,430 ERROR [STDERR] Exception in thread "DefaultQuartzScheduler_Worker-7"
    2009-10-21 16:00:01,461 ERROR [STDERR] java.lang.NoClassDefFoundError: com/sun/jndi/ldap/ctl/PagedResultsControl
    2009-10-21 16:00:01,461 ERROR [STDERR]      at com.thortech.xl.integration.ActiveDirectory.tcADUtilLDAPController.searchResultPageEnum(Unknown Source)
    2009-10-21 16:00:01,461 ERROR [STDERR]      at com.thortech.xl.schedule.tasks.ADLookupReconTask.performReconciliation(Unknown Source)
    2009-10-21 16:00:01,461 ERROR [STDERR]      at com.thortech.xl.schedule.tasks.ADLookupReconTask.execute(Unknown Source)
    2009-10-21 16:00:01,461 ERROR [STDERR]      at com.thortech.xl.scheduler.tasks.SchedulerBaseTask.run(Unknown Source)
    2009-10-21 16:00:01,477 ERROR [STDERR]      at com.thortech.xl.scheduler.core.quartz.QuartzWrapper$TaskExecutionAction.run(Unknown Source)
    2009-10-21 16:00:01,477 ERROR [STDERR]      at Thor.API.Security.LoginHandler.jbossLoginSession.runAs(Unknown Source)
    2009-10-21 16:00:01,477 ERROR [STDERR]      at com.thortech.xl.scheduler.core.quartz.QuartzWrapper.execute(Unknown Source)
    2009-10-21 16:00:01,477 ERROR [STDERR]      at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
    2009-10-21 16:00:01,493 ERROR [STDERR]      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    2009-10-21 16:00:01,493 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: ADP ClassLoader failed to load: com.sun.jndi.ldap.ctl.PagedResultsControl
    2009-10-21 16:00:01,493 ERROR [STDERR]      at com.thortech.xl.dataobj.tcADPClassLoader.findClass(Unknown Source)
    2009-10-21 16:00:01,493 ERROR [STDERR]      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    2009-10-21 16:00:01,508 ERROR [STDERR]      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    2009-10-21 16:00:01,508 ERROR [STDERR]      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    2009-10-21 16:00:01,508 ERROR [STDERR]      ... 9 more
    I believe I have my AD connector configured properly.
    My domain is dc=test-oim,dc=local
    Any help would be greatly appreciated.
    Thanks in Advance.
    -Bryan

    You might have to add ldapbp.jar in the class path. either place it in jdk lib or oim ext lib directory.
    Hope this helps,
    Saggu

  • Last Run Result Email Alert from Scheduled Task

    Hi All,
    Ive a newly require need to move 3 files from a local server to a remote server via FTP each evening.
    Local server is a Server 2008 box.
    I have setup WinSCP to transfer the files over successfully via a Scheduled Task
    Now i need alerting!!
    Ive setup the email function in Task Scheduler and it does send me an email but a pretty pointless one at that as it doesn't tell you the Last Run Result status code.
    So all i know is the job has run but i don't know if with errors etc.
    Each morning ill have to FTP to the remote server and manually check the time and date stamps myself to make sure the copy was successful.
    Ive checked the event log and it writes an Event ID 201 to the Task Scheduler Event Log and that has all the info i need in the description, but i cant attach that event to my scheduled task as there are lots of 201's for all different scheduled tasks that
    run that by the OS.
    Anybody know how i can get the last Run Result in the body of the email or the subject line at least - so i know if it is a 0x0 the job has been successul and anything other than 0x0 that there has been a problem.
    Any suggestions?
    Thanks in advance.

    Here is what a failed task looks like.  Note the non-zero result code:  EventID
    203 / Level 'Error' / ResultCode=2147942667
    Log Name: Microsoft-Windows-TaskScheduler/Operational
    Source: Microsoft-Windows-TaskScheduler
    Date: 10/26/2013 7:50:22 PM
    Event ID: 203
    Task Category: Action failed to start
    Level: Error
    Keywords:
    User: SYSTEM
    Computer: WTest
    Description:
    Task Scheduler failed to launch action "C:\Program Files\Acer Incorporated\HID Monitor\HIDMonitor.exe" in instance "{ad897acd-b254-459c-b246-bee11d4b87f2}" of task "\HIDMonitor". Additional Data: Error Value: 2147942667.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider Name="Microsoft-Windows-TaskScheduler" Guid="{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}" />
    <EventID>203</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>203</Task>
    <Opcode>101</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2013-10-26T23:50:22.438999200Z" />
    <EventRecordID>230110</EventRecordID>
    <Correlation ActivityID="{AD897ACD-B254-459C-B246-BEE11D4B87F2}" />
    <Execution ProcessID="768" ThreadID="2632" />
    <Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
    <Computer>W8Test</Computer>
    <Security UserID="S-1-5-18" />
    </System>
    <EventData Name="ActionLaunchFailure">
    <Data Name="TaskName">\HIDMonitor</Data>
    <Data Name="TaskInstanceId">{AD897ACD-B254-459C-B246-BEE11D4B87F2}</Data>
    <Data Name="ActionName">C:\Program Files\Acer Incorporated\HID Monitor\HIDMonitor.exe</Data>
    <Data Name="ResultCode">2147942667</Data>
    </EventData>
    </Event>
    ¯\_(ツ)_/¯

  • How to make Robocopy run in the foreground using Scheduled Tasks

    Hello everyone! 
    I am doing a daily backup using Robocopy and Scheduled Tasks running Windows 2012 Server. When it runs, robocopy runs in the background and does not write to log that I am pointing to. How can I make it run in the foreground? Also, is there anyway to write to log only those records that have been copied or purged? what are the best practices for robocopy use?
    Here is the script:
    date /t >> log.txt
    time /t >> log.txt
    ROBOCOPY \\CENTURY1\d$\ f:\  /MIR /R:0 
    time /t >> log.txt
    This topic first appeared in the Spiceworks Community

    Hello everyone! 
    I am doing a daily backup using Robocopy and Scheduled Tasks running Windows 2012 Server. When it runs, robocopy runs in the background and does not write to log that I am pointing to. How can I make it run in the foreground? Also, is there anyway to write to log only those records that have been copied or purged? what are the best practices for robocopy use?
    Here is the script:
    date /t >> log.txt
    time /t >> log.txt
    ROBOCOPY \\CENTURY1\d$\ f:\  /MIR /R:0 
    time /t >> log.txt
    This topic first appeared in the Spiceworks Community

  • Unable to Configure a PowerShell Script to Run as a Scheduled Task

    Hi ,
    I have a powershell script from Dieters blog http://scug.be/dieter/2011/07/06/scom-2007-how-to-backup-your-unsealed-management-packs/#comment-1058 which backups the unsealed management packs in SCOM. I am able to run the script successfully in the powershell
    prompt but when i schedule it as a task it fails with an error code 1.
    "Task Scheduler successfully completed task "\Backup Unsealed Management Pack" , instance "{xxxxxxxxxxxxxxxxxxxxxxxxxxxx}" , action "Powershell.exe" with return
    code 1."
    I am running the task using the highest privilages and have tried bypassing the script using and have configured the script as per http://www.metalogix.com/help/Content%20Matrix%20Console/SharePoint%20Edition/002_HowTo/004_SharePointActions/012_SchedulingPowerShell.htm
    -ExecutionPolicy Bypass c:\scripts\myscript.ps1
    Still i am unable to run the task without errors. Kindly assist.
    Jesty

    Hi Jesty,
    Please make sure you have followed these steps to schedule a powershell script task:
    1.  Save the powershell script as .ps1 in local computer.
    2.  Right click the .ps1 file and run with powershell and check if the script can run successfully.
    3.  schedule task->action:Start a program->Program/script:powershell.exe->Add argument:-ExecutionPolicy Bypass c:\scripts\myscript.ps1
    Best Regards,
    Anna

  • Windows Server Backup scheduled task run successfully but backup do not start (not running) on Windows Server 2012

    Hi,
    A backup job has been setup on Windows Server 2012 (Platform: Win32NT; ServicePack: ; Version: 6.2.9200.0; VersionString : Microsoft Windows NT 6.2.9200.0) via Windows Backup Software UI (Local Backup 1.0).
    It is appearing as a scheduled task "\Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup" belonging to user 'nt authority\system' in task scheduler.
    The problem is that the Backup job never start despite the scheduled task running and completing successfully (when run automatically or manually)!
    Would you be able to explain why and assist in resolving that issue?
    Here is what we know:
    When the backup is run manually via the Windows Backup Software UI, it works fine.
    When the backup is run via command line (as set in schedule task) in a cmd command prompt (as local/domain 'administrator' or as 'nt authority\system' which is possible by running command prompt via 'PsExec.exe -i -s cmd'), something like "%windir%\System32\wbadmin.exe
    start backup -templateId:{f11eb3aa-74e7-4ff4-a57b-d8d567ee3f77} -quiet", it works fine.
    If you manually run the preset scheduled task while logged in as administrator, the task run and complete successfully but the backup job does not start.
    Idem if you schedule task is run automatically at scheduled time.
    The schedule task run and complete successfully but the backup job does not start.
    It is confirmed by running the following in a command prompt as 'nt authority\system':
    schtasks /run /tn "\Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup"
    SUCCESS: Attempted to run the scheduled task "\Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup".
    Despite success result, the Backup job does not start running...
    No errors or warning appears anywhere in Event Logs (Microsoft > Windows > Backup or Task Scheduler) nor in the scheduled task History tab. The schedule task complete successfully but no Backup job is run...
    If scheduled task automatically set by Windows Backup software is duplicated (copied) and set manually it runs fine as 'administrator' and as 'nt authority\system' (subject that 'nt authority\system' is added to the 'Backup Operators' AD group).
    Here is an export of the current pre-set schedule task, is there any settings that need to be changed to make it works?
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
      <RegistrationInfo>
        <Author>MYDOMAIN\SERVER1</Author>
        <SecurityDescriptor>D:AR(A;OICI;GA;;;BA)(A;OICI;GR;;;BO)</SecurityDescriptor>
      </RegistrationInfo>
      <Triggers>
        <CalendarTrigger id="Trigger 1">
          <StartBoundary>2014-07-14T21:00:00</StartBoundary>
          <Enabled>true</Enabled>
          <ScheduleByDay>
            <DaysInterval>1</DaysInterval>
          </ScheduleByDay>
        </CalendarTrigger>
      </Triggers>
      <Principals>
        <Principal id="Author">
          <UserId>S-1-5-18</UserId>
          <RunLevel>HighestAvailable</RunLevel>
        </Principal>
      </Principals>
      <Settings>
        <MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
        <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
        <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
        <AllowHardTerminate>true</AllowHardTerminate>
        <StartWhenAvailable>true</StartWhenAvailable>
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
        <IdleSettings>
          <StopOnIdleEnd>false</StopOnIdleEnd>
          <RestartOnIdle>false</RestartOnIdle>
        </IdleSettings>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <Enabled>true</Enabled>
        <Hidden>false</Hidden>
        <RunOnlyIfIdle>false</RunOnlyIfIdle>
        <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
        <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
        <WakeToRun>false</WakeToRun>
        <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
        <Priority>7</Priority>
      </Settings>
      <Actions Context="Author">
        <Exec>
          <Command>%windir%\System32\wbadmin.exe</Command>
          <Arguments>start backup -templateId:{f11eb3aa-74e7-4ff4-a57b-d8d567ee3f77} -quiet</Arguments>
        </Exec>
      </Actions>
    </Task>
    Thank you in advance for your feedback.

    Once again, the issue is not to run the backup manually from the command line but to have it run via the scheduled task setup by the Windows Backup software.
    By default, the schedule task is to be run as NT Authority\System, and when run under this account, the backup does not start (even though account is member of Backup Operators) and job can manually be run via elevated command prompt. This is not a normal
    behavior and constitute a major bug in Windows Server 2012.
    From my understanding the NT Authority\System account is a built-in account from Windows that should by default be part of the Administrators group (built-in) even though it does not explicitly appears like it in AD by default.
    This account shall have by default Administrators rights and Backup Operators rights (via the Administrators group) without being explicitly added to those groups (http://msdn.microsoft.com/en-gb/library/windows/desktop/ms684190%28v=vs.85%29.aspx). By design
    it is supposed to be the most powerful account which has unrestricted access to all local system resources. If that is not the case (as it seems) then this would constitute a major bug in Windows Server 2012 edition.
    As said previously and as you confirmed, currently by default NT Authority\System on Windows 2012 server cannot start backup manually via an elevated command prompt unless it is manually added to Backup Operators (or Administrators) group. But wouldn't that
    constitute a bug of Windows Server 2012?
    Our server has not yet been restarted since I added NT Authority\System account to the Administrators group explicitly manually so I cannot yet confirmed it would sort the issue. Indeed it is heavily in use so cannot easily be restarted. Will confirm when
    done.
    We also have an additional problem where after a while of last reboot, part of the Exchange ECP can no longer be properly loaded in the web browser due to compilation error (compilation is done via NT Authority\System account which seems to no longer have
    sufficient right to compile .NET code). What is strange is that it works at first and then stop working at some point... I am hopeful that adding NT Authority\System to the Administrators group would sort this issue as well but once again, that shall not be
    needed!!!
    Could a Windows Server 2012 update introduced some security policy changes or else that prevent NT Authority\System to have full power?

  • I get NoSuchMethodError but cant run program with Static

    Hi, I got this silly problem. My program is meant to display a input dialog an then write to a file. Sounds so simple. But java wanted to make things hard for me and i got a NoSuchMethodError. I know that i am meant to us Public Static Void Main (String arg) but when i do this i get error "this can be referenced as static". Here is the source, do you know how to fix this.(an how can i?)
    Thnx
    My Regards
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.lang.String;
    public class sender implements Runnable {
    int i= 0;
    String mes;
    public void main (String[] arguments) {
    Thread th = new Thread (this);
    th.start ();
    //sender();
    while (true){}
    public void start () {
    Thread th = new Thread (this);
    th.start ();
    public void run() {
    try {
    Thread.sleep(3000);
    } catch (InterruptedException e) {}
    String mesdialog = JOptionPane.showInputDialog(null,
    "Enter your message");
    mes = mesdialog.toString();
    try {
    //FileOutputStream of = new
    //FileOutputStream ("send.txt");
    FileWriter of = new
    FileWriter("send.txt");
    //BufferedReader in = new
    // BufferedReader(fr);
    //while (true) {
    int i = 66;
    boolean eof = false;
    int inChar = 0;
    do {
    inChar = mes.hashCode();
    if (inChar != -1) {
    char outChar = (char)inChar ;
    of.write(outChar);
    //of.write(mes,0,20);
    } else
    eof = true;
    } while (!eof);
    //outfile.write(input);
    } catch (IOException e) {
    System.out.print("AAA ERROR");}
    }

    public static void main (String[] arguments) {
    Thread th = new Thread (new sender());
    th.start ();
    //sender();
    while (true){}
    }You can't reference "this" from a static context. main is required to
    be static.
    matfud

  • Is this program thread safe?

    This program does not throw any exception or error.
    But sec Property is binding with secRotate's angleProperty and secRotate angleProperty is added to secHand's Transforms. This means that secProperty eventually affects Graphics.
    Do I have to call Platform.runLater() ?
    h2. Clock
    public class Clock extends Application {
         private Calendar calendar = Calendar.getInstance();
         private IntegerProperty sec = new SimpleIntegerProperty();
         @Override
         public void start(Stage primaryStage) throws Exception {
              Group root = new Group();
              Circle outer = new Circle(100, 100, 100, Color.DARKBLUE);
              Circle inner = new Circle(100, 100, 90, Color.web("EFEFEF"));
              Line secHand = new Line(100, 100, 100, 20);
              secHand.setStroke(Color.RED);
              root.getChildren().addAll(outer, inner, secHand);
              Rotate secRotate = new Rotate(0, 100, 100);
              secRotate.angleProperty().bind( sec.divide(60.0).multiply(360.0) );
              Thread thread = new Thread(new Runnable() {
                   public void run() {
                        while (true) {
                             setTime();
                             try {
                                  TimeUnit.SECONDS.sleep(1);
                             } catch (InterruptedException e) {
                                  e.printStackTrace();
              },"Clock Thread : NOT ON JavaFX Application Thread");
              thread.setDaemon(true);
              thread.start();
              secHand.getTransforms().add(secRotate);
              Scene scene = new Scene(root, 200, 200);
              primaryStage.setScene(scene);
              primaryStage.show();
         public void setTime() {
              System.out.println(Thread.currentThread().getName());
              calendar.setTimeInMillis(System.currentTimeMillis());
              sec.set( calendar.get(Calendar.SECOND ));
         public static void main(String[] args) {
              launch(args);
    }

    So, basically JavaFX doesn't tell me if I wrongly access nodes in another thread?Sometimes it does, sometimes it doesn't.
    Here is an example of what happens when the system detects an operation off the JavaFX Application Thread which should only happen on the JavaFX Application Thread (it throws an exception)
    // output:
    // java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX-Launcher
    // and a stack trace for each illegal access.
    import javafx.application.Application;
    import javafx.scene.control.*;
    import javafx.scene.web.WebView;
    import javafx.stage.Stage;
    // demonstrates RT-17716: Some controls can only be created on the FX application thread
    public class InitThreadTest extends Application {
      public static void main(String[] args) { Application.launch(args); }
      @Override public void init() throws Exception {
        new Button();
        try { new WebView(); } catch (Exception e) { e.printStackTrace(); }
        try { new Tooltip(); } catch (Exception e) { e.printStackTrace(); }
        try { new ContextMenu(); } catch (Exception e) { e.printStackTrace(); }
      @Override public void start(Stage s) { System.exit(0); }
    }There may be plans to add more checks in more places, but I don't think there will ever be full coverage due to potential issues with performance, cluttering up the codebase, determining all the edge cases etc.
    do I have to call timeline.play() "in Java FX Application thread" if timeline has a KeyValue which is associated with Nodes property ?This is a very interesting question.
    No, you don't have to call timeline.play() on the JavaFX Application Thread.
    Irrespective of what thread the timeline was created in and play called from, the keyframe callback (and I would also surmise KeyValue manipulation) only happens on the Java FX Application thread.
    // output:
    // Main thread: Thread[main,5,main]
    // Init thread: Thread[JavaFX-Launcher,5,main]
    // FX thread: Thread[JavaFX Application Thread,5,main]
    // My thread: Thread[Thread-3,5,main]
    // Init launched timeline callback thread: Thread[JavaFX Application Thread,5,main]
    // My thread launched timeline callback thread: Thread[JavaFX Application Thread,5,main]
    import javafx.animation.*;
    import javafx.application.*;
    import javafx.event.*;
    import javafx.stage.Stage;
    import javafx.util.Duration;
    public class TimelineThreadTest extends Application {
      public static void main(String[] args) throws InterruptedException {
        System.out.println("Main thread: " + Thread.currentThread());
        Application.launch();
      @Override public void init() throws Exception {
        System.out.println("Init thread: " + Thread.currentThread());
        // print the timeline callback thread name after a second.
        Timeline t = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {
          @Override public void handle(ActionEvent actionEvent) {
            System.out.println("Init launched timeline callback thread: " + Thread.currentThread());
        t.play();
      @Override public void start(final Stage stage) throws Exception {
        System.out.println("FX thread: " + Thread.currentThread());
        stage.setWidth(5); stage.setHeight(5);
        stage.show();
        // create a new thread test timeline processing.
        new Thread() {
          @Override public void run() {
            System.out.println("My thread: " + Thread.currentThread());
            Timeline t = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {
              @Override public void handle(ActionEvent actionEvent) {
                System.out.println("My thread launched timeline callback thread: " + Thread.currentThread());
            t.play();
            try { Thread.sleep(2000); } catch (InterruptedException e) { /** no action required */ }
            Platform.runLater(new Runnable() { @Override public void run() { stage.close(); } });
        }.start();
    }Note that the callback to the FX application thread can only be setup and occur once the JavaFX system has been launched.
    This means Timelines are not useful outside of an FX application (e.g. for simulations or in a headless testing system) - which is unfortunate.
    // output:
    // My thread: Thread[Thread-0,5,main]
    // Timeline is never executed even though play is called on it.
    import javafx.animation.*;
    import javafx.event.*;
    import javafx.util.Duration;
    public class TimelineMainTest {
      public static void main(String[] args) throws InterruptedException {
        // print the timeline callback thread name after a second.
        Timeline t = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {
          @Override public void handle(ActionEvent actionEvent) {
            System.out.println("Timeline thread: " + Thread.currentThread());
        t.play();
        // create a new thread to wait a couple of seconds and prevent the main thread from shutting
        // down until we are sure the timeline thread has been given a chance to take action.
        new Thread() {
          @Override public void run() {
            try { Thread.sleep(2000); } catch (InterruptedException e) { /** no action required */ }
            System.out.println("My thread: " + Thread.currentThread());
        }.start();
    }

  • Security Violation Error while running schedule task from OIM.

    Hi All,
    I am getting this error while running a custom java schedule task from OIM:
    *Thor.API.Exceptions.tcAPIException [EJB:010160] Security Violation: User '<anonymous>' has insufficient permission to access EJB:*
    type=<ejb>,application=Xellerate,module=xlDataObjectBeans.jar,ejb=tcReconciliationoperations,method=createDeleteReconciliationEvent
    at Thor.API.Operations.tcReconciliationOperationsClient.createDeleteReconciliationEvent(UnKnown Source).
    I got this error as soon as my code start creating Delete Reconciliation Event.
    Note: I have already protected the JNDI Namespace.
    Please provide some pointers.
    Regards,
    Sunny

    Hi Rajiv,
    Check this:
    package com.centrica.iam.scheduletask;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileFilter;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Set;
    import oracle.iam.connectors.common.ConnectorLogger;
    import com.thortech.xl.dataaccess.tcDataSet;
    import com.thortech.xl.dataaccess.tcDataSetException;
    import com.thortech.xl.dataobj.PreparedStatementUtil;
    import com.thortech.xl.orb.dataaccess.tcDataAccessException;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    import Thor.API.tcResultSet;
    import Thor.API.Exceptions.tcAPIException;
    import Thor.API.Exceptions.tcInvalidValueException;
    import Thor.API.Operations.tcLookupOperationsIntf;
    import Thor.API.Operations.tcReconciliationOperationsIntf;
    import Thor.API.Operations.tcSchedulerOperationsIntf;
    public class CustomFlatFile extends SchedulerBaseTask {
         private static tcSchedulerOperationsIntf schedulerIntf;
         private static tcLookupOperationsIntf lookupIntf;
         private static tcReconciliationOperationsIntf reconIntf;
         String sObjectName;
         String LookupName;
         String LookupName2;
         String FileDirectory;
         String FileName;
         String File;
         String delimeter;
         String isDeleteTrue;
         HashMap<String, String> attrMap = new HashMap();
         HashMap<String, String> delMap = new HashMap();
         HashMap<String, String> finalMap = new HashMap();
         ArrayList list = new ArrayList();
         public boolean isReconStopped;
         public CustomFlatFile()
              isReconStopped = false;
         public void init()
              LookupName = getAttribute("Attribute Lookup Name");
              FileDirectory = getAttribute("Directory Path");
              FileName = getAttribute("File Name");
              delimeter = getAttribute("Delimeter");
              sObjectName = getAttribute("Resource Object Name");
              isDeleteTrue = getAttribute("Is Delete Allowed");
         public void execute(){
              try {
                   System.out.println("Start Exceute");
                   //Initiate lookupIntf
                   lookupIntf = (tcLookupOperationsIntf)getUtility("Thor.API.Operations.tcLookupOperationsIntf");
                   reconIntf=(tcReconciliationOperationsIntf)getUtility("Thor.API.Operations.tcReconciliationOperationsIntf");
                   catch (tcAPIException tcapiexception){
                        tcapiexception.printStackTrace();
                        //logger.error(classname, s, tcapiexception.toString());
                        //logger.setStackTrace(tcapiexception, classname, s, tcapiexception.getMessage());
                   catch (Exception excep){
                        excep.printStackTrace();
                        //logger.error(classname, s, excep.toString());
                        //logger.setStackTrace(excep, classname, s, excep.getMessage());
                   attrMap = readLookup(LookupName);
                   System.out.println(attrMap.toString());
                   readFile();
                   if (isDeleteTrue.equalsIgnoreCase("true"))
                        performDelete();
                   System.out.println("Finish Execute");
         public void performDelete()
              System.out.println("Start Perform delete");
              int k = list.size();
              System.out.println("list size " + list.size());
              try
                   Thread.sleep(15000);
         /*     Hashtable ahashtable[] = new Hashtable[k];
              Hashtable hashtable = new Hashtable();
              for (int i=0;i<k;i++)
                   hashtable.put("User Id", list.get(i));
                   ahashtable[i] = hashtable;
                   System.out.println(list.get(i));
              Set set = reconIntf.provideDeletionDetectionData(sObjectName, ahashtable);
              System.out.println("Set--" + set.toString());
              tcResultSet tcresultset = reconIntf.getMissingAccounts(sObjectName, set);
              System.out.println("tcresultset - " + tcresultset.getRowCount());
              if (!(tcresultset.isEmpty()))
                   long l[] = reconIntf.deleteDetectedAccounts(tcresultset);
                   for (int i1=0;i1<l.length;i1++)
                        System.out.println("delete recon key " + l[i1]);
              //Get the existing list of Managed users
                   tcDataSet tcdataset = new tcDataSet();
                   tcDataSet tcdataset1 = new tcDataSet();
                   String query = "select orf.orf_fieldname,prf.prf_columnname, sdk.sdk_name from orf, sdk, pkg, tos, prf, obj " +
                             "where pkg.obj_key = obj.obj_key and pkg.pkg_key = tos.pkg_key and tos.sdk_key is not null " +
                             "and tos.sdk_key=sdk.sdk_key and tos.tos_key=prf.tos_key and prf.prf_iskey='1' and prf.orf_key=orf.orf_key " +
                             "and orf.orf_parent_orf_key is null and obj.obj_name='" + sObjectName + "'";
                   tcdataset.setQuery(getDataBase(), query);
                   tcdataset.executeQuery();
                   String FFName = tcdataset.getString("prf_columnname");
                   String FName = tcdataset.getString("sdk_name");
                   String ROFName = tcdataset.getString("orf_fieldname");
                   System.out.println("form- " + FName + " Field- " + FFName);
                   query = "select " + FFName + " from " + FName + " udtable, oiu a, ost b " +
                             "where udtable.orc_key=a.orc_key and a.ost_key=b.ost_key and b.ost_status!='Revoked'";
                   System.out.println(query);
                   tcdataset1.setQuery(getDataBase(), query);
                   tcdataset1.executeQuery();
                   int i = tcdataset1.getRowCount();
                   ArrayList list1 = new ArrayList();
                   String s1 = null;
                   System.out.println("N. of rows--" + i);
                   for (int j=0;j<i;j++)
                        tcdataset1.goToRow(j);
                        s1 = tcdataset1.getString(0);
                        System.out.println("s1---" + s1);
                        if (!(list.contains(s1)))
                             list1.add(s1);
                             System.out.println("under if--" + s1);
                   //Getting the existing list of unmanaged users
                   query = "select distinct (b.rcd_value) from rce a, rcd b, orf c, obj d where a.rce_key=b.rce_key and " +
                             "b.orf_key=c.orf_key and c.orf_fieldname='" + ROFName + "' and a.rce_status!='Event Linked' " +
                                       "and a.obj_key = d.obj_key and d.obj_name='" + sObjectName + "'";
                   tcdataset1.setQuery(getDataBase(), query);
                   tcdataset1.executeQuery();
                   i = tcdataset1.getRowCount();
                   System.out.println("No. Of Unmanaged Users " + i);
                   for (int j=0;j<i;j++)
                        tcdataset1.goToRow(j);
                        s1 = tcdataset1.getString(0);
                        System.out.println("s1---" + s1);
                        if (!(list.contains(s1)))
                             list1.add(s1);
                             System.out.println("under if--" + s1);
                   int k1 = list1.size();
                   System.out.println("list1 size--" + k1);
                   for (int j1=0;j1<k1;j1++)
                        delMap.clear();
                        delMap.put(ROFName, (String)list1.get(j1));
                        System.out.println(delMap.toString());
                        long l = reconIntf.createDeleteReconciliationEvent(sObjectName, delMap);
                        System.out.println("delete recon key--- " + l);
              catch (Exception exception)
                   exception.printStackTrace();
         public void readFile(){
              String s = "readFile()";
              //logger.setMethodStartLog(classname, s);
              HashMap map = new HashMap();
              try {
              File = getFile();
              BufferedReader reader = new BufferedReader(new FileReader(new
                        File(File)));
              String line = "";
              int k = attrMap.size();
              String value[] = new String[k];
              String Header[]= new String[k];
              if (delimeter.equalsIgnoreCase("|"))
                   delimeter = "\\" + delimeter;
                   line = reader.readLine();
                   Header = line.split(delimeter);
                   while((line = reader.readLine()) != null)
                        value = line.split(delimeter);
                        k = value.length;
                        for (int i = 0;i<k;i++){
                             finalMap.put(attrMap.get(Header), value[i]);
                        System.out.println(finalMap.toString());
                        System.out.println("Start Ignoring Event");
                        if (!(reconIntf.ignoreEvent(sObjectName, finalMap)))
                             System.out.println("Not Ignored");
                        long l1 = reconIntf.createReconciliationEvent(sObjectName, finalMap, true);
                        System.out.println("Recon Key--" + l1);
                        else
                             System.out.println("ignore event ---" + finalMap.toString());
                        list.add(finalMap.get("User Id"));
                        System.out.println(list.size() + "add--" +finalMap.get("User Id") );
                        finalMap.clear();
              catch (Exception exception)
                   exception.printStackTrace();
         public boolean stop(){
              String s = "stop()";
              //logger.setMethodStartLog(classname, s);
              //logger.info(classname, s, "Stopping Reconciliation........");
              isReconStopped = true;
              //logger.setMethodFinishLog(classname, s);
              return true;
         FileFilter fileFilter = new FileFilter()
         public boolean accept(File file)
         String sFilePath = file.getName();
         if( sFilePath.startsWith(FileName) )
         return true;
         else
         return false;
         public String getFile() throws FileNotFoundException, Exception{
              String s = "getFile()";
              //logger.setMethodStartLog(classname, s);
              String s1;
              File dir =     new File(FileDirectory);
              File[] files = dir.listFiles(fileFilter);
              if (files.length ==0)
                   throw new FileNotFoundException();
              if (files.length>1)
                   throw new Exception("Multiple Matches found for this file name");
              s1 = files[0].toString();
              //logger.setMethodFinishLog(classname, s);
              return s1;
         public HashMap readLookup(String s1){
              String s = "readLookup()";
              //logger.setMethodStartLog(classname, s);
              HashMap map = new HashMap();
              try {
              tcResultSet tc1=     lookupIntf.getLookupValues(s1);
              int i = tc1.getRowCount();
              for (int j = 0;j<i;j++){
                   tc1.goToRow(j);
                   map.put(tc1.getStringValue("Lookup Definition.Lookup Code Information.Code Key"), tc1.getStringValue("Lookup Definition.Lookup Code Information.Decode"));
              catch (tcAPIException tcapiexception){
                   tcapiexception.printStackTrace();
                   //logger.error(classname, s, tcapiexception.toString());
                   //logger.setStackTrace(tcapiexception, classname, s, tcapiexception.getMessage());
              catch (Exception excep){
                   excep.printStackTrace();
                   //logger.error(classname, s, excep.toString());
                   //logger.setStackTrace(excep, classname, s, excep.getMessage());
              return map;

  • Scheduled task won't run .bat file

    Hi. On Windows Server 2008 I have a scheduled task that calls a .bat file. The fist step in the .bat file is write to a log file to the same directory in which the .bat file exists. This allows me to find out if it is ever run. When the .bat file is run from a command prompt it runs as expected writing to the log file and completing its actions. My problem is that when I run the scheduled task manually or allow it to run when scheduled it appears to run but the .bat file is never run. No log file is ever created. The History tab in the properties of the scheduled tasks shows the task being started and running then completing with an operation code of 2. I've disabled the UAC for the user account. I've set the task to run as the Administrator user and verified the permissions for that user. I know the password is correct for the task because I can make changes to the properties and save those changes with the username/password. I'm at a loss for further troubleshooting steps. Can anyone point me in the right direction to figure out why these .bat files are not being run? 

    So I had this problem, I double clicked on the .bat and notepad opened the .bat.  I ran through this whole long and very absorbing thread of this forum.   I wanted to save the entries that were most helpful, so I copied and pasted into
    a notepad document (.txt)  I could not find a way to attach it here, so I copied and pasted that below. I called it a synopsis....  Did I spell that right?
    As you can see, I added my experience at the top (A and B).  The stuff I copied is noted with the original author. This is the first time I posted anything to these here microsoft forums, although I have been telling computers what to do for 40+ years. 
    So hope I did not break any social protocols here.
    ==================================== Begin ====================================
         Running A Dot Bat File in Windows Server 2008 Vista 7 etc and beyond V01
    ============================================================================
    This was created as a synopsis of the entries at the following forum location:
    http://social.technet.microsoft.com/Forums/en/winservermanager/thread/d47d116e-10b9-44f0-9a30-7406c86c2fbe
    A) manually
         This is an opinion added by Thomas Rock
        1) Open a command window (that would be cmd.exe)
        2) In the command window navigate to the directory containing the .bat file and it's dependents
               ex...  C:\Program Files (x86)\Bobs\Your\Uncle
        3) Run the .bat file by typing the name including the .bat extension (in the command window of course)
                 TheBatFile.bat
           Note: Using this method, the .bat file will run in the current command window directory (the directory where the .bat file is located)
                             (this is the key for getting it to run in the task scheduler... Start in folder option)
    B) The double click
                This is an opinion added by Thomas Rock
         1) Using Windows exlporer, find the .bat file
         2) use the mouse or other device to double click on the .bat file
         3) if it does not run (in my case the wordpad application opened the .bat file)
              a) make sure that the .bat file extension is associated with the program c:\windows\system32\cmd.exe
              b) make sure the profile you are using has rights to run the cmd.exe
              c) make sure the profile has the rights to the directories, the .bat and any other objects used or affected by the .bat file processing.
    C) As a task using task scheduler
         Proposed As Answer by Brian Vandemark Wednesday, September 02, 2009 9:36 PM
    1) Make sure that the task is set to "configure for Windows Vista or Windows 2008" on the first page of the task properties (under the "general" tab)
    2) Make sure that the task is set to "start in" the folder that contains the batch file:
          a) open the task properties
          b) click on the "actions" tab
          c) click on the action and then the "edit" button at the bottom. 
          d) In the "Edit Action" Window there is a field for "start in (optional)" that you set to the path to the batch file.
          e) be sure to include an end backslash for the start in path "C:\dir1\dir2\"    (the last backslash is not optional)
    3) Make sure that the task is running as an account that has explicit "Full access" permissions to all these things:
          a) the .bat file itself
          b) the folder containing the .bat file
          c) the target files/folders that are affected by the .bat script. 
               Note:  Inherited permissions did not seem to work.
    4) Make sure that the account running the task is a member of the local "administrators" group for this machine
    5) Make sure that the task is set to "run whether logged on or not"
    6) Tick the box "Run with highest privileges".    
           Note: Point 6 here was from Edson F. Lima Wednesday June 30 2010 1:35 PM
                      The original point 6 was moved to point 7.
    7) The Task should run successfully with expected output when you right-click on the task and select "run" 
            If it does that then it will run successfully when you are logged off.
    D) Still another way as a task using task scheduler
          Proposed As Answer byDarren Wallace Thursday, July 15, 2010 1:41 AM
    This has been bugging me for 6 or 7 months.
    I don't have admin rights to the box and the guy who does is very busy...
    so I've felt the range of emotions mentioned above.
    I tried most everything above as well. But what seemed to get my processes processing, was ...
       • on the General tab, I clicked the Change User or Group button
       • in Select User or Group (first smaller dialog box)  I clicked the Advanced... button
       • in the next Select User or Group (second bigger dialog box) I clicked the Find Now button
       • in the Search results I selected the Administrators (a group) and it returned SERVERname\Administrators into the "Enter the object name to select" entry in the previous dialog box
       • then I clicked OK and returned to the General tab above
       • the options to Run only when user is logged on and Run whether user is logged on or not are no longer available
       • then I made sure that the Run with highest privileges was checked
       • then I clicked OK and during the next scheduled time to run ... it ran
       Note: See note in A) Manually above.
    E) Task scheduler recommendation
         Proposed As Answer byTamusJRoyceThursday, December 01, 2011 3:42 PM
    I have found .bat and .cmd files do not run correctly either.
        My solution:  Don't run the batch file directly. 
           Have TaskScheduler run:  cmd.exe
              with parameter:  /C YourBatchFile.bat
             and start in: C:\SomePath\ (without quotes!) where C:\SomePath\YourBatchFile.bat exists. 
            And then select the radio button for it to run regardless if you are logged in or not.
    Exit errors may not be logged to the Event Log (they weren't when the .bat ran directly from Task Scheduler when I was logged in), so I find it best to manually log your own Event in case a error occurs and you want to send an email.
     REM Logs an event which causes eventlog to send an email when it fails.  Also, "/l application" needs to be lowercase.
    eventcreate /t error /id 203 /l application /d "your logged description."
    And then make a completely separate task with a trigger:  On an event.  Basic Selected.  Log: Application.  Source: EventCreate. Event ID: 203.  And have the action on this task send an email (attaching any generated log files, if needed).
    Hopefully helpful (took me 3 days to figure all this out...gar)
    ===================================== End ===================================
         Running A Dot Bat File in Windows Server 2008 Vista 7 etc and beyond V01
    ============================================================================
     

  • KM Scheduler Task not running

    Hello All,
    I have created a scheduler task for the , for the same I have created a PAR file , have successfully Build the project and deployed , Have configured the time in the Global services . But for some reason I could not see the task being running in the "Component Monitor" (when I select the Services-->scheduler >select one of the CM systems (have two currently)>click on on the CM system ) I could not see my custom task .
    As well as When I go to "Service configuration" --> Portal Application , there also I could not see my custome application .
    Initially whenever there use to be any error (for example -- CM systems not assigned etc etc ).
    Is it something I am missing while deployement , Or has it being deployed properly?
    Regards,
    Ronniee

    Hello Detlev,
    Any Inputs on this please.
    I have opened a new thread but a different Query
    http://forums.sdn.sap.com/thread.jspa?threadID=2155357
    Regards,
    Ronniee.

  • Opening Excel Workbook Fails when run from Scheduled Task on Windows Server 2008 Rw

    Hi,
    I have a little vbs script that instantiates the Excel.Application object and then opens a work book to perform some tasks on it. The script runs fine when run from the command line. When I attempt to run it as a scheduled task (it is supposed to update
    data that is pulled from a SQL Server at regular intervals), it fails with the following error:
    Microsoft Office Excel cannot access the file 'c:\test\SampleWorkbook.xlsm'. There are several possible reasons: .....
    The file does exist. The path reported in the error is correct. The account under which the task is running is the same account I use to run it from the command line. User Account Control is not enabled, and the task is set up to run with highest privileges.
    When I run the same script through the Task Scheduler from a Windows Server 2003 machine, it works without issue.
    I was just wondering if somebody on this forum has run into a similar issue in connection with Windows Server 2008 R2 and figured out what the magic trick is to make it work. I'm sure it is rights related, but I haven't quite figured out what which rights
    are missing.
    Thanks in advance for any advice you may have.

    This is truly killing me ... trying to get it working on Windows Server 2012 without success.
    I desperately need to automate running Excel macros in a "headless" environment, that is non-interactive, non-GUI, etc.
    I can get it to work using Excel.Application COM, either via VBScript or Powershell, successfully on many other Windows systems  in our environment - Windows Server 2008 R2, Windows 7 (32-bit), etc.,  -BUT-
    The two servers we built out for running our automation process are Windows Server 2012 (SE) - and it just refuses to run on the 2012 servers - it gives the messages below from VBScript and PowerShell, respectively- 
    I have tried uninstalling and re-installing several different versions of Microsoft Excel (2007 Standard, 2010 Standard, 2010 Professional Plus, 32-bit vs. 64-bit, etc.), but it makes no difference.
    Would be extremely grateful if any one out there has had any success in running Excel automation on Server 2012 in a non-interactive environment that they could share.
    ( I have tried adding the "%windir%\syswow64\config\systemprofile\desktop"
    folder, which did fix the issue for me when testing on Windows Server 2008 R2, but sadly did not resolve it on Windows Server 2012 )
    [VBScript error msg]
    Z:\TestExcelMacro.vbs(35, 1) Microsoft Office Excel: Microsoft Office Excel cannot
    access the file 'Z:\TestExcelMacro.xlsm'. There are several possible reasons:
    • The file name or path does not exist.
    • The file is being used by another program.
    • The workbook you are trying to save has the same name as a currently open work
    [Powershell error msg]
    Exception calling "Add" with "0" argument(s): "Microsoft Office Excel cannot open or save any more documents because th
    ere is not enough available memory or disk space.
     To make more memory available, close workbooks or programs you no longer need.
     To free disk space, delete files you no longer need from the disk you are saving to."
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : ComMethodTargetInvocation
    You cannot call a method on a null-valued expression.
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull

  • [Forum FAQ] Group Policy Preferences Scheduled Tasks Item not working when the option Run whether user is logged on or not is selected

    Scenario:
    We use one of the following Group Policy Preferences Scheduled Tasks item to deploy a task to clients:
    Computer Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Scheduled Task (At least Windows 7)
    Computer Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Immediate Task (At least Windows 7)
    User Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Scheduled Task (At least Windows 7)
    User Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Immediate Task (At least Windows 7)
    (Note that on some platforms, "At least Windows 7" is replaced with "Windows Vista and later.")
    After designating a user account to run the task, we select “Run whether user is logged on or not” option, and “The Do not store password…”
    check box is automatically grayed out (See Figure 1).
    Figure 1
    After finishing configuring the task item, on a client, we run command
    gpupdate/force to forcefully update group policy. However, on the client, when we check if the task is listed in Task Scheduler snap-in, the task is not displayed, and when we run
    gpresult/h report.html to collect group policy result for troubleshooting, we see an error as similar as shown in the following figure (Figure 2).
    Figure 2
    Cause:
    To make the scheduled task run whether the user is logged on or not, we need to store the password of the designated user account. However, for the content of the scheduled
    task item is stored in Sysvol where it’s not safe to store passwords, this function has been deprecated.
    Workaround:
    We can run the task with system account
    NT Authority\System, or we can use specific user accounts to run the task when the given user is logged on. (See Figure 3)
    Figure 3
    Reference:
    MS14-025: Vulnerability in Group Policy Preferences could allow elevation of privilege: May 13, 2014
    http://support.microsoft.com/kb/2962486
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Hello Everyone,
    Succeeded !!!!!!!
    Even i was struggling with this same Problem to execute a batch via Window scheduler and set the setting to "Run whether the user is logged in or not".
    I tried many time but the batch runs with " Run
    whether user is logged on" and not with "Run
    whether user is logged on or not".
    what i discovered is that there was one mapped drive
    path in my batch file which was not the complete path like y:/AR.qvw actually what i did i changed that map path to the complete path like \\servnamename\d$\AR.qvw and the batch executed successfully with the setting "Run
    whether user is logged on or not"
    The
    conclusion is that check the dependency of the script on external resources because when you check this option "Run
    whether user is logged on or not" It actually conflicts. This my discovery.
    If
    you have any question write me on [email protected]
    Thanks
    & Regards,
    Arun

  • XLreporter scheduled tasks stopped running

    Hi Experts,
    We are experiencing problems on XLreporter scheduled tasks.
    They worked properly with sending emails as daily routine. However for some reason they stopped running in windows Task Scheduler. We can still run the jobs thru manually in XLreporter Organizer with correct result and sucessful logs. In the mean time the service of Task Scheduler is ok for other tasks than XLreporter.
    What we can see in Event Viewer is the error message with two other information message below for each run:
    Error:
    The VB Application identified by the event source logged this Application IXExecutor: Thread ID: 5904 ,Logged: An error occured while Initializing Job
    Object variable or With block variable not set
    Info:
    The VB Application identified by the event source logged this Application IXExecutor: Thread ID: 5904 ,Logged: Before deleting mclsIFDSApp
    Info:
    The VB Application identified by the event source logged this Application IXExecutor: Thread ID: 5904 ,Logged: IXExecutorProxy - ExecuteJob: Before Exit Sub
    The SBO version 8.8 PL14 on windows server 2003 R2 SP2 ,SQL Server 2005
    Can you please advise? Many thanks Ryan
    Edited by: Ryan Fu on Jun 22, 2011 3:55 AM

    Just found this one too:
    Note 855021
    If you want scheduled report jobs in XL Reporter to be executed independently of the logon status of the user who defined the job, you must allow Microsoft Excel to be started by the scheduled job.
    1. Choose Run from the Windows Start menu and type dcomcnfg.exe. A window called Component Services appears. Choose Component Services->Computers->My Computer->DCOM Config->Microsoft Excel Application from the list.
    2. Right-click on Microsoft Excel and choose Properties. Choose the Security tab.
    3. Choose Customize under Access Permissions and choose Edit...
    4. Choose Add... and choose Users and/or User Groups that require access to Excel. Then choose OK.
    5. Repeat the procedure for Customize under Launch Permissions.
    6. Choose the Identity tab.
    Choose This User.
    Choose a user that is a member of the administrator group from the browse button and enter password.
                  This user will be the one that is given access to Microsoft Excel when executing scheduled jobs. Normally this would be the Administrator user.

Maybe you are looking for