Skip to Content
0
Former Member
Nov 24, 2011 at 11:57 AM

Internal Function uSleep(60000) throwing a NoSuchElementException Error

158 Views

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