Redwood script - NPE for duplicate(), but the job exists.

Hi Everyone,
M33.104 - build version.
I'm tried the following code
JobDefinition newABAPJob = jcsSession.getJobDefinitionByName("DUP_TEST");
if (newABAPJob == null) {
newABAPJob = jcsSession.getJobDefinitionByName("SAP_AbapRun").duplicate();
newABAPJob.setName("DUP_TEST");
jcsSession.persist();
else {
jcsOut.println("JobDefinition already exists");
When i replaced SAP_AbapRun with a job definition i already have (as below), i received a Null Pointer Exception.
newABAPJob = jcsSession.getJobDefinitionByName("ECC_FIN_AP_TEMPLATE").duplicate();
Error:
57 more
Caused by: java.lang.NullPointerException: while trying to invoke the method com.redwood.scheduler.api.model.JobDefinition.duplicate() of a null object returned from com.redwood.scheduler.api.model.SchedulerSession.getJobDefinitionByName(java.lang.String)
at com.redwood.scheduler.custom.ShellScript_nandak.execute(ShellScript_nandak.java:17)
at com.redwood.scheduler.custom.ShellScript_nandakStub.jcsExecute(ShellScript_nandakStub.java:20)
... 62 more
The Job definition exists - screenshot below. The job is not a template. I tried with different job definitions that i created, it always failed.
But when i used SAP_AbapRun or SAP_AbapRunPrint, it is successful.
Please let me know what am i doing wrong?
Thanks
Nanda

Hi Nanda,
You are looking up the job definition in the wrong partition. As you do not provide the partition to lookup in, GLOBAL is assumed. You can try the following two alternatives:
newABAPJob = jcsSession.getJobDefinitionByName(jcsSession.getPartitionByName("FIN"), "ECC_FIN_AP_TEMPLATE").duplicate();
newABAPJob = BusinessKeyLookup.getJobDefinitionByBusinessKey(jcsSession, JobDefinition.OBJECT_TYPE + ":FIN.ECC_FIN_AP_TEMPLATE").duplicate();
Regards Gerben

Similar Messages

  • I have just purchased a new iMac OS Xlion version 10.7.3 and I'd like to install Windows. I have a disc for XP but the Boot Camp Assistant manual only refers to Windows 7. Please does anyone know if it will it work with XP.?

    I have just purchased a new iMac OS Xlion version 10.7.3 and I'd like to install Windows. I have a disc for XP but the Boot Camp Assistant manual only refers to Windows 7. Please does anyone know if it will it work with XP.?

    Get a Virtual Macine software program, Parallels, VMware Fusion or VirtualBox, and install XP in a virtual machine.
    You can't install XP in a Boot Camp Partition with Lion or Mt Lion, only Win 7.

  • I'm being asked to enter my ID password on my ipad for icloud, but the email is no longer active and reset remails are not being received.

    I'm being asked to enter my ID pswd on my ipad 2 for icloud. but the email address and ID are no longer being used, and reset emails are not being received. How can I deactivate this? I have another ID which works fine, but this issue with the old ID is not allowing me to use my ipad.  thanks.

    If your iPad is signed into an old ID and you are trying to change it, if the old ID is yours, and if it is an earlier version of your current ID, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • HT5444 I would like to use a copy of Mountain Lion for development, but the store tells me I cannot download it because my MacBook 4,1 is not compatible! What can I do to download it?

    I would like to use a copy of Mountain Lion for development, but the store tells me I cannot download it because my MacBook 4,1 is not compatible! What can I do to download it?
    I have paid for it and all...

    You can't do anything. See:
    OS X Mountain Lion - System Requirements
           Macs that can be upgraded to OS X Mountain Lion
             1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model Identifier 5,1 or later
             3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later
             4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later
             5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later
             6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later
             7. Xserve (Early 2009) - Model Identifier 3,1 or later
    Your computer does not meet the requirements to run Mountain Lion.
    Upgrading to Lion
    If your computer does not meet the requirements to install Mavericks, it may still meet the requirements to install Lion.
    You can purchase Lion at the Online Apple Store. The cost is $19.99 (as it was before) plus tax.  It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
         Lion System Requirements
           1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
               or Xeon processor
           2. 2GB of memory
           3. OS X v10.6.6 or later (v10.6.8 recommended)
           4. 7GB of available space
           5. Some features require an Apple ID; terms apply.

  • I just purchased a 3TB Time Capsule.  I live in Italy and have 220V power.  The Time Capsule is rated for that, but the cord says 125V.  Can I use this cord with an adapter, or do I need to buy a new cord at an Italian store?

    I just purchased a 3TB Time Capsule.  I live in Italy and have 220V power.  The Time Capsule is rated for that, but the cord says 125V.  Can I use this cord with an adapter, or do I need to buy a new cord at an Italian store?

    Due to the kind of plug used the US power cord is rated at the 125v value.. and legally we cannot advise you to use on higher voltages.. although I have never had issues in Australia.. 240v.
    But adapters from your Euro power plug to US are generally ugly .. unsightly things.. and often sit high above the socket and are none too stable.. I agree with Bob.. just go out and buy a standard figure 8 power cord.. check with Apple in Italy for a white one.. if you are going to have it on show.. black are far more common. Or even check ebay for a standard power Apple power cord as a number of items they sell use the figure8 socket. 

  • I have a MacBook Pro running Lion. I need to use Lion to run my Dragon. I would like to partition my drive to use Maverick for everything but the dictation software. I'm a new pie to apple

    I have a MacBook Pro running Lion. I need to use Lion to run my Dragon. I would like to partition my drive to use Mavericks for everything but the dictation software. I'm a newbie to apple

    To resize the drive do the following:
    1. Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    After the main menu appears select Disk Utility and click on the Continue button. Select the hard drive's main entry then click on the Partition tab in the DU main window.
    2. You should see the graphical sizing window showing the existing partitions. A portion may appear as a blue rectangle representing the used space on a partition.
    3. In the lower right corner of the sizing rectangle for each partition is a resizing gadget. Select it with the mouse and move the bottom of the rectangle upwards until you have reduced the existing partition enough to create the desired new volume's size. The space below the resized partition will appear gray. Click on the Apply button and wait until the process has completed.  (Note: You can only make a partition smaller in order to create new free space.)
    4. Click on the [+] button below the sizing window to add a new partition in the gray space you freed up. Give the new volume a name, if you wish, then click on the Apply button. Wait until the process has completed.
    You should now have a new volume on the drive.
    It would be wise to have a backup of your current system as resizing is not necessarily free of risk for data loss.  Your drive must have sufficient contiguous free space for this process to work.

  • I was told I need to remove the enterprise server account I have and need to add a new one for work but the IT person did not tell me how to do this.  Can anyone help?

    I was told I need to remove the enterprise server account I have and need to add a new one for work but the IT person did not tell me how to do this.  Can anyone help?

        Jennymbell, never fear help is here!
    Have you tried contacting your IT department for assistance? You can visit http://bit.ly/QECbGh for steps on how to enterprise activation.
    Keep me posted if you need further assistance.
    John B
    Follow us on Twitter @VZWSupport

  • I'm tying to make a payment for photoshop but the fields on the payment form won't allow me to enter the correct card information.  Im based in Japan but my card is registered to a UK address.  the fields only allow for a Japanese style address and postco

    I'm tying to make a payment for photoshop but the fields on the payment form won't allow me to enter the correct card information.  Im based in Japan but my card is registered to a UK address.  the fields only allow for a Japanese style address and postcode.  What can i do to complete the payment and get photoshop!

    As far as I know, your registered location and your credit card information must match... but,
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • I was charged for a movie that never was downloaded, i asked for it but the conection was too slow and I never was able to have the movie that i asked for...how can i get it without being charged again, who could remove the chage from my Crecit card?

    i was charged for a movie that never was downloaded, i asked for it but the conection was too slow and I never was able to have the movie that i asked for...how can i get it without being charged again, who could remove the chage from my Crecit card?

    You may not be able to get a refund, since the terms of sale for the iTunes Store state that all sales are final. You can contact the iTunes Store, explain the reason for your request, and ask, though:
    http://www.apple.com/support/itunes/contact.html
    It's possible they'll make an exception for you, particularly if the problem was on their end preventing the movie from downloading in a reasonable time.
    Good luck.

  • I've forgetten my password ID and I can't restore it though you send me an e\mail for it but the e-mail isn't arrive to my account at all. what am I suppose to do in order to restore my password ID?

    I've forgetten my password ID for ([email protected]) and I can't restore it though you send me an e\mail for it but the e-mail isn't arrive to my account at all. what am I suppose to do in order to restore my password ID?

    http://iforgot.apple.com

  • TS1368 My account keeps asking for Region but the drop down menu lists Cities in China. I can,'t cange the region in my account because it asks me to check the date and time but these are correct. Any answers please?

    My account keeps asking for Region but the drop down menu lists Cities in China. I can,'t cange the region in my account because it asks me to check the date and time but these are correct. Any answers please?

    Look, I understand I still need a card attached to the account. The problem is, it won't accept my card because I only have 87 cents in my bank account right now.
    If I had known there would be so much trouble with the iTunes card, I would have just put the cash in my bank account in the morning instead of buying an iTunes card (I didn't expect the banks to be open on Thanksgiving of course).
    Apple will only accept cards that have a balance. The balance is so small in my account that it won't accept it as a valid card.
    I'm going to have to contact Apple anyway to reset the security questions. That's obvious. Your answers were not exactly helpful. You didn't tell me anything I don't already know, but thanks for trying to be helpful.

  • PO routed for approval but the PO does not require release

    Hi Guys i have an issue,
    My ECC PO Routed for approval, but the PO doesnot requre Release as its was below the approval limit. Workflow should not be routed , but then also the user got the Workitem

    Iam not sure about what iam proposing but, take a look at this SPRO settings in the prodcution system.
    1. See based on the release code that is sent to workflow , the workitem will be sent to user or not.
    2. Copy release code that is passed to workflow container (you can get this from workflow log technichal details SWIA or SWI1)and check in the table T16FC, if the entry is found then check the field FRGWF - Role resolution for workflow is initial or not if it is not initial then try to make it initial and then trigger the workflow.
    here the possible vallues in the field FRGWF are 1 or 9 if any one of them is set with respect to that releasecode , i think that indicates that the workflow will try to determine the release code agent from t he defined organizational structure.
    if you make it initial then,  i hope the workitem will not be sent to the releasecode agent.
    Please check this system table
    [Please check this SAP help Document|http://help.sap.com/erp2005_ehp_04/helpdata/EN/04/92775546f311d189470000e829fbbd/frameset.htm]

  • I got a AppStore Card for Christmas but the code is unreadable, what can i do?

    I got a AppStore Card for Christmas but the code is unreadable, what can i do?

    Click here and request assistance. Include as much of the code as you can.
    (73231)

  • Regarding Adobe form for development but the ADS always has a problem

    Hi,
    Currently we are using Adobe form for development but the ADS always has a problem in EC6 as below.
    Test Program: Version Information (for Analysis Only)
    System Error
    ERROR CODE: 100.101
    ERROR MESSAGE: SOAP Runtime exception: CSoapExceptionTransport : HTTP receive failed with exception communication_failure
    SOAP Framework error: SOAP Runtime Exception: CSoapExceptionTransport: HTTP receive failed with exception communication_failure(100.101).
    Would you pls help to figure it out?
    Thanks & Regards,
    Suneetha

    Hi,
    It seems that you ADS settings have not been maintained,
    check the note
    944221 Troubleshooting if problems occur in forms processing
    Hope this resloves your issue,if not revert back.
    Regards,
    Vamshi.

  • I'm trying to register for iTunes, but the page says my phone number is not valid.

    I'm trying to register for iTunes, but the page keeps telling me that my phone number is not valid.  Is there some trick I don't know about?

    Hey,
    The iTunes store has web based support available here: http://www.apple.com/support/itunes/store/
    You can also email the iTunes Store from the links on that page.
    MBP 2.0, 2GB ram Mac OS X (10.4.7)

Maybe you are looking for

  • Report In SAP

    Dear All,               I posted all expenses at debit side and credited Provision for expenses GL. Is there any report available where I can see Total provision for expenses and all Expenses which are debited to provision for expenses at column leve

  • HDD for Time Machine and other stuff

    Just a very short question.. Can I use my external harddrive for Time Machine and for example putting files on it to take it to my friend, or the otherway around, put files on it and take it back home? The reason I ask this is that I hooked up a USB

  • ACE Chain Certificates in mobile devices

    Hi, I'm having an issue with intermediate certificates from GoDaddy when connecting from some browsers of mobile devices: Browser in Android 2.3.3; Safari in iOS 4.2.1; Chrome 18 in Android 4.0. In a PC there's no problem, only from the above mobile

  • Where can I find the Mid-East version of InDesign

    As a Creative Cloud user I'm told I can download the Mideast version of InDesign but I can't find it anywhere. Any help? Thanks

  • Bugs in my background image

    I wrote a GUI that display a background image. There are other component like combo box, label etc...that are added to a panel that is superpose to the background. Everthing in my program works except that when my frame appear, the background image c