Skip to Content
author's profile photo Former Member
Former Member

Internal Function uSleep(60000) throwing a NoSuchElementException Error

Hi Everyone

I've searched the forum for use of the Internal Function uSleep which I am using to delay the execution of a subsequent pass. I'm using the Java runtime engine . I found one other reference http://forums.sdn.sap.com/thread.jspa?threadID=2010006 which makes it look really easy to use ...

so I have a simple JavaScript function:

// Main function: z_sleepJobExecution

//used in:LDAP Initial Load and Delta - interrupt User Load to let LDAP connections clear

function z_sleepJobExecution(Par){
	Par = ""//Just added to see if giving Par a value will clear the error
	
	outstring = uSleep(60000);
	uWarning("Sleeping the job for a 60 second Pause"  );
	uWarning("This pass appears to error but is actually working");

	return;//Just added to see if adding return will clear the error
}

The delay is working, and gives the previous pass the 60 seconds needed to clear the open LDAP connections, before the next pass starts opening new ones - so my original problem is now solved.

The issue is that this error is now written to the log, however, above my first uWarning in the xml log, but below it in the DSE.log:

Running pass failed with unhandled exception

java.util.NoSuchElementException

23.11.2011 19:14:43 :I:runPass:To Generic
23.11.2011 19:14:53 :W:Sleeping the job for a 10 second Pause - Value of Par:init - {}
23.11.2011 19:14:53 :W:This pass appears to error but is actually working
23.11.2011 19:14:53 :I:initPass ToGeneric: Pause Job Execution - To Generic
23.11.2011 19:14:53 :E:Exception running class ToGeneric
java.util.NoSuchElementException
	at java.util.Vector.firstElement(Unknown Source)
	at com.sap.idm.ic.ToPass.putNextEntry(ToPass.java:848)
	at com.sap.idm.ic.DSERunTime.runToPass(DSERunTime.java:3122)
	at com.sap.idm.ic.DSERunTime.runPass(DSERunTime.java:3677)
	at com.sap.idm.ic.DSERunTime.runJob(DSERunTime.java:1429)
	at com.sap.idm.ic.DSERunTime.loopJob(DSERunTime.java:845)
	at com.sap.idm.ic.DSERunTime.doCommand(DSERunTime.java:2252)
	at com.sap.idm.ic.DSERunTime.doCommand(DSERunTime.java:351)
	at com.sap.idm.ic.DSERunTime.run(DSERunTime.java:4161)
	at com.sap.idm.ic.DSERunTime.main(DSERunTime.java:4056)
23.11.2011 19:14:53 :I:To Generic pass completed in 10.063 seconds.
23.11.2011 19:14:53 :I:Handled: 0 Warnings: 2 Failed: 2:

So while I can live with it from a development perspective, from a BAU perspective we have the issue that seeing red lines in the job log that are known errors means you may not look in detail at the job log and therefore new genuine errors are "cloaked". Clearly the preference is that this pass does not throw an error meaning all red lines in the job log are errors to be reviewed.

Any ideas very welcome, I was wondering about some error handling but not sure how to catch it.

Thanks very much,

Andy

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2011 at 05:26 PM

    I would remove the "outstring =" from the start of uSleep (unless it really does return a string) which would seem strange.

    also have a space between the quotes in par, but as you said it shouldn't matter to the error message.

    Hope this helps

    Tony

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Tony - I started with

      function z_sleepJobExecution(Par){
      		uSleep(10000)//pause for 10 seconds to let previous LDAP connections clear

      and built all other code up from there to try and clear the error.

      Tried this again to check and still get the same NoSuchElementException ;-(

      function z_sleepJobExecution(Par){
      	Par = " ";
      	
      	uSleep(60000);
      	uWarning("Sleeping the job for a 60 second Pause"  );
      	uWarning("This pass appears to error but is actually working");
      	uWarning("Value of Par:" + Par)
      
      	return;
      }

  • author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2011 at 08:47 AM

    Hi,

    It looks like the problem is reported the caller of this script, not by the script itself.

    I notice that there is no return value from the script you show. Make sure this is handled properly where the funciton is called.

    Best regards

    John Erik Setsaas

    Development Architect IdM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.