How can I create a one time cron schedule that would execute only once in C#?

I have used cron schedule in C# to create an application that should trigger a job only once. This code piece is throwing an exception, An unhandled exception of type 'Quartz.SchedulerException' occurred in Quartz.dll
Below is my code:
class Program
static void Main(string[] args)
Test();
public static void Test()
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
IScheduler scheduler = schedulerFactory.GetScheduler();
IJobDetail jobDetail = JobBuilder.Create<SatellitePaymentGenerationJob>()
.WithIdentity("TestJob")
.Build();
Console.WriteLine(DateBuilder.DateOf(16, 30, 00, 24, 2, 2015));
//ITrigger trigger = TriggerBuilder.Create()
// .ForJob(jobDetail)
// .WithCronSchedule("0 0 12 20 4 ? *")
// .WithIdentity("TestTrigger")
// .StartNow()
// .Build();
ITrigger trigger = TriggerBuilder.Create()
.WithDescription("Once")
.WithSimpleSchedule(x => x.RepeatForever().WithRepeatCount(1))
.StartAt(DateBuilder.DateOf(12, 43, 00, 26, 2, 2015))
.Build();
scheduler.ScheduleJob(jobDetail, trigger);
scheduler.Start();
internal class SatellitePaymentGenerationJob : IJob
public void Execute(IJobExecutionContext context)
Console.WriteLine("test");
I believe that the way I have done scheduling to be execute only once is causing the issue. Please advice.
mayooran99

Hi mayooran99,
From the additional information: Repeat Interval cannot be zero. The screenshot
as below.
You should specify a repeat interval in seconds. 
Please try the following code
ITrigger triggers = TriggerBuilder.Create()
.WithDescription("Once")
.WithSimpleSchedule(x => x
.WithIntervalInSeconds(20)
.RepeatForever())
.StartAt(DateBuilder.DateOf(12, 43, 00, 26, 2, 2015))
.Build();
Have a nice day!
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How can I create a one time mouseover that expands the stage

    i have 4 circles on a stage that is 1000 px wide and 200 px high.  When I hover over one of the circles I want the stage to expand to 1000 px wide and 500 px high.  But I want that to only occurs once when I hover over any one of the circles.
    SO I guess my question is how do a make a mouseover that only occurs once and does not repeat itself when I hover over that object again. 
    Thanks!

    Just add a variable in compositionReady
    var open = true;
    then on you mouseover event in compositionReady add
    sym.$('circleName').bind('click', function(){
    if(open==true){
    // code for your mouseover
    open=false;
    }else{
    // code for your other state

  • My daughter accidentally dumped my iTouch into the tub.  It is ruined.  How can I receive my one time regrant on all the songs I've lost.  There were approximately 80 songs I purchased on iTunes.  They get me through the day!  Please help!

    My daughter accidentally dumped my iTouch into the bath tub.  It is ruined.  How can I receive my one time regrant to get back the 80 plus songs I purchased and downloaded on iTunes?  I'm devastated....please help!  My husband bought me the new iPhone4 for my new Mother's Day gift.  I would like to download all the songs I lost.  Thank you so much!

    You can redownload the songs as many times as you want, the "one time regrant" no longer exists. Make sure you are using the same apple id on both your dead itouch and your iphone 4. On your iphone 4 go to the itunes app > Purchased (may be under more based on your settings) at the top click not on this iphone, click all songs then click the little cloud next to each song you want to redownload. It will prompt you for your id and password and the begin your download

  • How can I create a Face Time account.  I have an Apple ID and password.  When I Google how to create an account all I get is what I need for the system

    I have a 13" MacPro.  How can I create a Face Time account.  I have an Apple ID and password.  When I Google how to create an account all I get is what I need for the system

    You don't need to create an account.   Your use your Apple ID to log into Facetime.
    If you haven't already you will need to download the Facetime App from the Mac App Store.
    https://itunes.apple.com/us/app/facetime/id414307850?mt=12&ls=1
    FaceTime for Mac: Troubleshooting FaceTime - Apple Support

  • How can I create an internal hyperlink in iWeb? Would like to put an interactive menu at the top of a page.

    How can I create an internal hyperlink in iWeb? Would like to put an interactive menu at the top of a page.

    Do you meant a link to one of your other pages or to a location on one of your pages?  If it's the latter those are called anchors and iWeb does not support them.  However, there are workarounds for that.  See this blog: How to use anchors in iWeb.  If you don't have a lot of widgets on the page it can work fairly well.
    OT

  • How can I create a one-click download for a PDF file?

    I want to have several PDF files on the website ... for downloading. How do I create a one-click download button? for those who don't know about control-right-clicking to download something?
    Does such a possibility exist?
    Ben

    Hi Quicktime Kirk,
    Thank you. And that leads me to another question: I've used the zip function before, with the idea of making a smaller file for transfers; but the PDF I get from Pages doesn't seem to compress any more when supposedly further compressed by .zip. Meaning, same size files.
    Is this supposed to be like this? And, just so I understand, the file needs to be a .zip file for this one-click function to work? Have I got that right? Or will it work just as well with the .pdf file? Given there is no difference in the compression.
    Ben

  • How can I create additional "Sent Mail" folders so that I can organize my sent mail along the same lines as the inbox? I use Mail v 4.5

    How can I create additional or sub "Sent Mail" folders so that I can organize my sent mail along the same lines as the inbox? I use Mail v 4.5.

    Thank you for your reply Don, but I had already gone through that procedure and it will only create new mailboxes for received mail. I want to create new mailboxes for sent mail, i.e. the first column being "to" not "from". Under the Mailbox menus there is an option "Use This Mailbox For" but all the options under that (including Sent) are greyed out. Unfortunately the View/Columns option to change from "From" to "To" changes all mailboxes not just the active one.

  • How can I create a one image per page caption sheet that includes the description in Bridge?

    I am trying to find a way to create a one-image-per-page caption sheet for my workflow. I currently place each image into Word and copy the description onto the document, then repeat for each image. I am hoping that there is a way to automate this process using Bridge. I know that it can be done using Lightroom, however, that is not currently an option for me. Is this something that can be done or am I bound, like Sisyphus to Microsoft Word? I have a very limited grasp of scripting, but I feel like this is possible.
    Thanks for any help.

    To create a NetBoot image, you could just put the cluster node in target mode and attach it to your PowerBook. Then use SIU to create the NetBoot image.
    If you're trying to create a backup image of the disk, use hdiutil, or put in in target mode and create the image with Disk Utility.

  • How can I create an installer for my project that can work on 32-bit Windows if I have 64-bit Windows Vista?

    Hi, 
    I made a LabVIEW project that works perfectly and made an installer for it. I tested the installer on my own computer and everything worked well. The goal for my installer was to put it on multiple computers. So I tried to do this on another computer that has Vista 32-bit and it told me that the installer can only run on 64-bit computers. I tried to choose to install run-time 32bit and it did not change anything, there was still a message to tell me that this installer only can be ran on 64-bit computers. How can I make an installer that works on 32-bit computers? 
    Thank you. 
    Solved!
    Go to Solution.

    Langelier wrote:
    Will my project work on 32-bit version even if created on 64-bit version?
    The code will have to recompile, but yes it should work.  I recommend making a backup before proceeding just in case.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can i create a photobook with a layout that respect standard photo format?

    I used iphoto to create a photobook but there is serious problem, i can use only fixed layout and this layouts are problems.
    I can't put my shoot in standard photographic format, so i need to zoom and move my photo to fit well in your fixed layout.
    I can't change the composition of all my shoots to fit in wrong layout.
    There is a way to disable layout and put manually the photo in original format on pages?
    Thank you
    Mario Aprea

    iPhoto books can only be created using the fixed templetes supplied - you can not modify them
    I have no idea what a "standard Photographic Format is" - neither I nor Google knows that that is
    So I do not understand what you want to do
    One possible suggestion is that in a book you can right click on a photo (in most temes) and use the fit to frame option to show an entire photo that is in the wrong dimensions
    LN

  • How can you create an instance of a class using ClassLoader given only

    the class name as a String. I have the code below in the try block.
    Class myTest = this.getClass().getClassLoader().loadClass("Testclass");
    Object obj = myTest.newInstance();
    String className = obj.getClass().getName();I don't want to typecast the class like
    Testclass obj = (TestClass) myTest.newInstance();I want to be able to create the classs at runtime and then get the methods in the class and execute those methods. Can it be done without having to code the typecasting in before compile time?

    I read on the web of people creating objects from interfacesDoesn't sound like the thing to do... Theoretically you could create dummy classes on the fly that implement some interface, but that's not very useful.
    Sounds like you are trying to load classes and execute them via interfaces. Like this:
         Class clazz = Class.forName("java.util.LinkedList");
         Collection c = (Collection) clazz.newInstance();
         c.add("hello");
         c.add("world");
         System.out.println(Arrays.toString(c.toArray()));LinkedList is the class, Collection is the interface which LinkedList implements. You can then call the methods declared in the interface. The interface gets "compiled in" into the program and the classes that implement it get loaded whenever and from wherever you load them.
    You could also use reflection to call methods without an interface, but that is type-unsafe, inelegant, hackish, and just plain ugly.

  • How can I create a Cell Format in Numbers that doesn't display zeroes?

    I can't figure this out. I need to view numbers in a column decimal aligned. If the number has trailing digits then all trailing zeros need to be removed up to the number of decimals to display. All remaining trailing zeros need to be hidden (not replaced with a space as a space isn't the same with as a digit). Below is a simple example I hacked in Photoshop. The first column shows the real entered value and the right it's displayed value. Note that the cell in red is showing that the trailing zero has been replaced with nothing but the decimal point is still aligned.

    Hi Mike,
    No sign of your photoshopped image, so I'm guessing about what you want here.
    Does this resemble what you're looking for?
    Column B contains the initial entries (made from the keyboard). I wasn't expecting to see the trailing zeroes retained in these.
    All cells in columns C and D contain the formula shown above the table, =B, a simple cell reference to the column B cell on the same row as the formula.
    Column C's format is left as the default "Automatic". As can be seen, all trailing zeroes are removed.
    Cells in column D have had their format set as shown in the Inspector pane to the right of the table.
    The value in these cells is still the same as the value in column B, and that is the value that would be used in any calculations referencing these cells. Formatting affects only the display of the cell contents. What is displayed is the value in the cell, rounded to two decimal places.
    Regards,
    Barry

  • I would like to use an external drive for the iPad I just purchased for my husband?  How can I accomplish this is there an accessory that would allow me to use a USB

    I would like to use an external drive for storage on the ipad I just purchased.   How can I do this?

    You can't attach drives to any iOS device.
    Having said that, there are some drives with built-in wifi routers that a device can connect to.  These would behave like a cloud device in which some of your apps might be able to connect.
    Try googling to find some brands.

  • How can I create a form with a button that adds a new page of fields to fill out?

    Hi,
    I have a one-page form created in Acrobat Pro 9 that contains five fields for a user to complete. I'd like to give the user the option of adding a page with the same five fields to fill out. The user finishes those fields, presses an "Add a Page" button, and then gets another page to fill out, and so on. When finished, their PDF form might be 10 pages long, at which point the user can save it as a single PDF file. Is this possible to do in Acrobat Pro 9 or 10, and if so, how?
    Thanks,
    Andrew

    When I created a new template like you told me, I wasn't given the option to rename the fields. See screenshot below. I'm just given the option to add a new template. Changing it refers to changing the template to a different page.
    If you can show me how to have the fields renamed automatically or use the rename parameter, I think that should fix it.
    Under Tools>JavaScript>Document JavaScripts, I've added a Script named "PackagingArtwork".
    // Here is the code
    function PackagingArtwork()
    {this.createTemplate({cName: "PackagingArtwork", nPage: 5});
    // Here the code that spawns the template
    var PackagingArtworkArray = this.templates;
              var PackagingArtwork = PackagingArtworkArray[0];
              PackagingArtwork.spawn(this.numPages, false, false);
    This is what the JS debugger said.
    Acrobat EScript Built-in Functions Version 10.0
    Acrobat SOAP 10.0
    var t1 = createTemplate("t1", 0);
    var oXO = t1.spawn({nPage: numPages, bOverlay: false});
    while (numPages < 50) {
        t1.spawn({nPage: numPages,  bOverlay: false, oXObject: oXO});
    undefined
    [object CosObj=<<Stream>>]
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1

  • How can I create a buffer, array or pipeline that stores the last 5000 dates of a voltage measurement with PCI6036 & SCXI1104C and continously drops the last date and inserts the latest date (scanrate 200 or 2000Hz)?

    I develope a porgramm for continious monitoring. If the voltage of a channel exceeds or is lower than the upper or lower limit of tolerance the actual date must be stored and additionally the dates being stored 10sec before and after this event. Can somebody give some advice how to create the buffer to keep the dates 10s before the error event? Thank U.

    I've written you a quick array buffer vi. I'm not sure if it'll be fast enough though.. Try it and see! I've used the loop numbers in my array, but i'm sure you can feed in the dates instead.
    Attachments:
    Array_buffer.vi ‏26 KB

Maybe you are looking for

  • Troubles with the hold button...

    Simply put, my hold button no longer reliably works. If I turn it on, perhaps one out of four times does it actually put the iPod into "hold" mode and prevent the buttons from changing settings. Has anyone had the same problems and are there any simp

  • CSS to print in landscape

    I currently have an grid that i need to print from a form. When i try to print the grid it is too wide to be printed in portrait. I have made a CSS that forces the page to print in landscape, but when added to the style sheet that uix uses the grid d

  • Captivate will not launch

    I have used Captivate once, on a trial basis, some many months ago. At the time I purchased the subscription (valid still) and worked with it a few times. I have only returned to it recently and the program will not launch. The icon appears in my Mac

  • Why are static methods called with null references,valid ?

    This is my code : package inheritance; public class inh6{      public static void method(){      System.out.println("Called");      public static void main(String[] args){           inh6 t4 = null;      t4.method(); O/P : CalledHere t4 is a null refe

  • LIDE210 Scanner - how to do full uninstall?

    Bought the LIDE210 scanner, and while it initially worked fine, I got some settings messed up and couldn't figure out how to correct them, even with the on screen manual. So I uninstalled and reinstalled, but same issue. I've uninstalled again, and w