Arul,

Did you check to see what the value that you are assigning to the 
workDirectory value is?  What is its value?  You can log it before the 
<process> element is run to see.  For example:

    <script>workDirectory = '%s/../../bin' % (STAXCurrentXMLFile)</script>
    <log>'workDirectory=%s' % (workDirectory)</log>

If STAXCurrentXMLFile is a Windows file name (e.g. 
C:\stax\scenario1\testA.xml), then using that as a relative working 
directory (e.g. C:\stax\scenarios1\testA.xml\..\..\bin) when running a 
process on a Linux machine obviously will not work.

If STAXCurrentXMLFile is a Linux file name (either because your STAX 
service machine is a Linux machine or because the XML file specified 
resides on a Linux machine and you specified the Linux machine using the 
MACHINE option on your STAX EXECUTE request), and it's directory structure 
exists on the Linux machine where the you are running the process, then 
this will work if you remove the file name part of the machine.  For 
example, if STAXCurrentXMLFile = '/stax/scenario1/testA.xml', then remove 
the '/testA.xml' and then add '../bin'.  You can use the Python os.path 
module's dirname(path) method to do this.  For example:

    <script>
      import os.path
      workDirectory = '%s/../bin' % (os.path.dirname(STAXCurrentXMLFile))
    </script>

    <log>'workDirectory = %s' % (workDirectory)</log>

    <!-- Then you can use workDirectory in a <process> element's <workdir> 
->

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




arul prakash <arulprakas...@gmail.com> 
06/02/2010 03:06 AM

To
staf-users@lists.sourceforge.net
cc

Subject
[staf-users] relative path not resolving in linux






hi,
    I am using relative path to specify the  working directory for the 
process, but STAX is not able to resolve it.

workDirectory='%s/../../bin' % (STAXCurrentXMLFile)

the path doesnt get resolved in linux but in windows

the error i am getting is 'invalid working directory' in STAX.

-- 
Regards,
Arul

------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to