Note that when developing a new STAX job, you should look at using the STAX Monitor (if you haven't already). The STAX Monitor makes it easy to debug problems in your STAX job and provides the ability to display the job log and job user log at a click of a button (not that submitting a LOG QUERY request to query a STAX log is hard...).
-------------------------------------------------------------- Sharon Lucas IBM Austin, luc...@us.ibm.com (512) 286-7313 or Tieline 363-7313 From: Arve Knudsen <arve.knud...@gmail.com> To: David Bender/Austin/i...@ibmus Cc: staf-users@lists.sourceforge.net Date: 10/06/2010 09:42 AM Subject: Re: [staf-users] How to get error information from STAX job Hi David I know why the job fails, in fact I want it to (as an example of handling such errors). I am meaning to submit the job from a Python script. It sounds pretty kludgy having to query the log to figure out what went wrong, isn't there some more direct way to catch the error? Arve On Wed, Oct 6, 2010 at 4:24 PM, David Bender <bda...@us.ibm.com> wrote: The error is occurring because your function defines a required argument, but you did not specify the argument on the STAX EXECUTE request. So, if you get the following: >STAF local STAX EXECUTE FILE C:/STAF/services/stax/test.xml MACHINE local WAIT RETURNRESULT Response -------- { Job ID : 3 Start Date-Time: 20101006-09:17:06 End Date-Time : 20101006-09:17:06 Status : Terminated Result : org.python.core.pyinsta...@1187984 Testcase Totals: { Tests : 0 Passes: 0 Fails : 0 } } Then you can query the STAX job log to get detailed information about the error: >STAF local LOG QUERY MACHINE {STAF/Config/MachineNickname} LOGNAME STAX_Job_3 Response -------- Date-Time Level Message ----------------- ----- ------------------------------------------------------- 20101006-09:17:06 Start JobID: 3, File: C:\STAF\services\stax\test.xml, Machine : local, Function: NoOp, Args: null, JobName: <N/A> 20101006-09:17:06 Error STAXFunctionArgValidate signal raised. Terminating job. ===== XML Information ===== File: C:\STAF \services\ stax\test.xml, Machine: local Line <Error in ARGS optio n>: Error in element type "<External>". Required argum ent "arg1" is not provided in the call to function "NoO p". ===== Call Stack for STAX Thread 1 ===== [] 20101006-09:17:06 Info Terminating block: main 20101006-09:17:06 Statu Testcase Totals: Tests: 0, Pass: 0, Fail: 0 s 20101006-09:17:06 Statu Job Result: org.python.core.pyinsta...@1187984 s 20101006-09:17:06 Stop JobID: 3 If you execute the job via the STAX Monitor, then you will see the error in the Messages panel: 20101006-09:21:12 STAXFunctionArgValidate signal raised. Terminating job. ===== XML Information ===== File: C:\STAF\services\stax\test.xml, Machine: local://local Line <Error in ARGS option>: Error in element type "<External>". Required argument "arg1" is not provided in the call to function "NoOp". ===== Call Stack for STAX Thread 1 ===== [] And then if you specify the function argument on the STAX EXECUTE request, then the job completes successfully: >STAF local STAX EXECUTE FILE C:/STAF/services/stax/test.xml MACHINE local ARGS ['myArg'] WAIT RETURNRESULT Response -------- { Job ID : 6 Start Date-Time: 20101006-09:23:34 End Date-Time : 20101006-09:23:34 Status : Normal Result : None Testcase Totals: { Tests : 0 Passes: 0 Fails : 0 } } David Bender (Embedded image moved to file: pic06340.gif)Inactive hide details for Arve Knudsen ---10/06/2010 05:49:05 AM---Hello I am new to STAF/STAX and am trying to implement a jobArve Knudsen ---10/06/2010 05:49:05 AM---Hello I am new to STAF/STAX and am trying to implement a job as a STAX function. (Embedded image (Embedded image moved to file: pic19455.gif) moved to file: Arve Knudsen <arve.knud...@gmail.com> pic22724.gif) From: (Embedded image (Embedded image moved to file: pic28598.gif) moved to file: staf-users@lists.sourceforge.net pic24105.gif) To: (Embedded image (Embedded image moved to file: pic11994.gif) moved to file: 10/06/2010 05:49 AM pic13956.gif) Date: (Embedded image (Embedded image moved to file: pic05163.gif) moved to file: [staf-users] How to get error information from STAX job pic16872.gif) Subject: Hello I am new to STAF/STAX and am trying to implement a job as a STAX function. First of all, I should like to get error information when the function call fails. So far I am testing by calling my function without its required arguments, but I can't for the life of me figure out how to get at the error. My STAX job definition is as simple as this: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE stax SYSTEM "stax.dtd"> <stax> <defaultcall function="NoOp"/> <function name="NoOp"> <function-list-args> <function-required-arg name="arg1"/> </function-list-args> <nop/> </function> </stax> I execute it with the command 'staf local stax EXECUTE FILE C:/Users/knuarv/STAX/test.xml MACHINE local WAIT RETURNRESULT'. The following information is then printed: Response -------- { Job ID : 51 Start Date-Time: 20101006-12:41:27 End Date-Time : 20101006-12:41:27 Status : Terminated Result : org.python.core.pyinsta...@de9738 Testcase Totals: { Tests : 0 Passes: 0 Fails : 0 } } How do I get the error information? I can see that it's failed, given that the Status is 'Terminated', but I need more detail. Thanks, Arve ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users
<<attachment: pic06340.gif>>
<<attachment: pic22724.gif>>
<<attachment: pic19455.gif>>
<<attachment: pic24105.gif>>
<<attachment: pic28598.gif>>
<<attachment: pic13956.gif>>
<<attachment: pic11994.gif>>
<<attachment: pic16872.gif>>
<<attachment: pic05163.gif>>
------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb
_______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users