Hi Sharon Lucas,

when I am running Java application under staf environment I got return code 1. when I am running Python application under staf environment I am getting return code 2.
                my python version is 2.7.3
                my java version 1.6
                my os is ubuntu

                STAF local MISC LIST PROPERTIES  output is,

                    version     : 3.4.12
                    platform    : linux
                    architecture: 32-bit
                    installer   : IA
                    file        : STAF3412-setup-linux.bin
                    osname      : Linux
                    osversion   : *
                    osarch      : x86

here, I am attaching files which producing above return codes. so kindly help me.

Thanks and regards,
N.Asok Kumar
from PySTAF import *
import sys
import time

try:
	handle = STAFHandle("STAFTestcase")
except STAFException, e:
        print "Error registering with STAF, RC: %d" % e.rc
        sys.exit(e.rc)
result = handle.submit("local", "var", "resolve string {STAF/Config/OS/Name}")

if (result.rc != 0):
        print "Error submitting request, RC: %d, Result: %s" % (result.rc, result.result)
else:
        print "OS Name: %s" % result.result
count=100
for x in range(0, count):
	print "Loop #" ,x
	result = handle.submit("local", "monitor", "log message " + "Loop # ")
	time.sleep(1)
if (result.rc != 0):
        print "Error submitting request, RC: %d, Result: %s" % (result.rc, result.result)

rc = handle.unregister()

sys.exit(rc)
import com.ibm.staf.*;
public class STAFTestcase
{
    public static void main(String[] args)
    {
        int counter = 10;  
        STAFHandle handle = null;
        try
        {
            handle = new STAFHandle("STAFTestcase");
        }
        catch(STAFException e)
        {
            e.printStackTrace();  
            System.exit(1);
        }
        if (args.length > 0) counter = (new Integer(args[0])).intValue();
        for (int i=0; i < counter; i++)
        {
            System.out.println("Loop #" + i);
            STAFResult result = handle.submit2("local", "monitor", 
                "log message " + 
                STAFUtil.unwrapData("Loop #" + i));    
            try
            {
                Thread.sleep(1000); // 1 second
            }
            catch(InterruptedException e)
            {
                e.printStackTrace();
            }                    
        }
        System.exit(0);
    }
}
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to