>As Jython is running on the STAX service machine

That explains everything - I found these files on the service machine.
Thanks for help very much!

Cheers,

Oleg Salyakhov.
SEGA Europe.

On Thu, Dec 8, 2011 at 6:49 PM, Sharon Lucas <luc...@us.ibm.com> wrote:

> Is your STAX service machine (the machine where the STAX service is
> registered) the same machine as the machine where you are submitting the
> STAX EXECUTE request to?  As Jython is running on the STAX service machine,
> this C:/Temp/log.txt file would need to exist on the STAX service machine
> for a Jython open() function to find it.
>
> Try running the following STAX job.  Does it work and what is it's STAX
> Job User Log output?  If it doesn't work, also check if there are any
> errors in the STAX JVM log.
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE stax SYSTEM "stax.dtd">
> <stax>
>
> <defaultcall function="Main"/>
>
> <function name="Main">
>   <sequence>
>
>     <script>
>       dirName = 'C:/Temp'
>       fileName = 'C:/Temp/log.txt'
>     </script>
>
>     <stafcmd>
>       <location>'local'</location>
>       <service>'FS'</service>
>       <request>'QUERY ENTRY %s' % (fileName)</request>
>     </stafcmd>
>
>     <log message="1">
>       'STAF local FS QUERY ENTRY %s, RC=%s, Result=\n%s' % \
>       (fileName, RC, STAFResultContext)
>     </log>
>
>     <script>
>       import os
>       listdirOutput = os.listdir(dirName)
>     </script>
>     <log message="1">
>       'os.listdir(%s)=%s' % (dirName, listdirOutput)
>     </log>
>
>     <script>
>       lstatOutput = os.lstat(fileName)
>     </script>
>     <log message="1">
>       'os.lstat(%s)=%s' % (fileName, lstatOutput)
>     </log>
>
>     <script>
>       f = open(fileName, 'r')
>       f.close()
>     </script>
>
>     <log message="1">'File open via Jython worked'</log>
>
>     <return>'Done'</return>
>
>   </sequence>
> </function>
>
> </stax>
>
> --------------------------------------------------------------
> Sharon Lucas
> IBM Austin,   luc...@us.ibm.com
> (512) 286-7313 or Tieline 363-7313
>
>
>
>
> From:        Oleg <oleg.salyak...@gmail.com>
> To:        Sharon Lucas/Austin/IBM@IBMUS,
> Cc:        staf-users@lists.sourceforge.net
> Date:        12/08/2011 12:24 PM
> Subject:        Re: [staf-users] Problem with file access on Windows 7
> system
> ------------------------------
>
>
>
> Thanks, I did everything that was suggested. Here is the  result:
>
> C:\STAF\bin>STAF local FS QUERY ENTRY C:/Temp/log.txt
> Response
> --------
> Name              : C:\Temp\log.txt
> Link Target       : <None>
> Type              : F
> Size              : 4
> Upper 32-bit Size : 0
> Lower 32-bit Size : 4
> Modified Date-Time: 20111208-18:10:16
>
> However, Jython still returns error:
> ....
> Line 152: Error in element type "script".
> ===== Python Error Information =====
>
> com.ibm.staf.service.stax.STAXPythonEvaluationException:
> Traceback (most recent call last):
>   File "<pyExec string>", line 1, in <module>
> IOError: (2, 'No such file or directory', 'C:/Temp/log.txt')
> .....
>
>
> On Thu, Dec 8, 2011 at 6:03 PM, Sharon Lucas 
> <*luc...@us.ibm.com*<luc...@us.ibm.com>>
> wrote:
> This does not have anything to do with the configuration of STAF or STAX.
>  It is strictly Jython that is trying to open the file and it is failing
> (it is not STAF that is trying to open the file).
>
> You could submit a STAF command to the STAF FS service to query the file
> to verify the STAF sees that this file exists on the STAX service machine.
>
> From the command line on your STAX service machine you can enter:
>
>   STAF local FS QUERY ENTRY C:/Temp/log.txt
>
> And, within your STAX job you could add the following right before your
> <script> element that uses Jython to try to open this file to verify that
> this file exists on the STAX service machine:
>
> <stafcmd>
>   <location>'local'</location>
>   <service>'FS'</service>
>   <request>'QUERY ENTRY C:/Temp/log.txt'</request>
> </stafcmd>
>
> <log message="1">
>   'STAF local FS QUERY ENTRY C:/Temp/log.txt, RC=%s, Result=\n%s' % (RC,
> STAFResultContext)
> </log>
>
> <script>
>   f = open('C:/Temp/log.txt', 'rb')
>   f.close()
> </script>
>
> <log message="1">'File open via Jython worked'</log>
>
> --------------------------------------------------------------
> Sharon Lucas
> IBM Austin,   *luc...@us.ibm.com* <luc...@us.ibm.com>*
> **(512) 286-7313* <%28512%29%20286-7313> or Tieline 363-7313
>
>
>
>
> From:        Oleg <*oleg.salyak...@gmail.com* <oleg.salyak...@gmail.com>>
> To:        Sharon Lucas/Austin/IBM@IBMUS,
> Cc:        
> *staf-users@lists.sourceforge.net*<staf-users@lists.sourceforge.net>
> Date:        12/08/2011 11:45 AM
> Subject:        Re: [staf-users] Problem with file access on Windows 7
> system
>  ------------------------------
>
>
>
> Yes, the user has access since it's an Admin account. However, I think
> this is not related to security access problem otherwise I would get
> 'access denied' error.
>
> I shutdown and started STAFProc again with no luck. Please help....
>
> Here is my staf.cfg:
>
> # Turn on tracing of internal errors and deprecated options
> trace enable tracepoints "error deprecated"
>
> # Enable TCP/IP connections
> interface ssl library STAFTCP option Secure=Yes option Port=6550
> interface tcp library STAFTCP option Secure=No  option Port=6500
> #option ConnectTimeout=65000
>
> # Set default local trust
> trust machine local://local level 5
>
> TRUST LEVEL 5 MACHINE *://*
>
> # Add default service loader
> serviceloader library STAFDSLS
>
>
> On Thu, Dec 8, 2011 at 5:07 PM, Sharon Lucas 
> <*luc...@us.ibm.com*<luc...@us.ibm.com>>
> wrote:
> Does the user that was logged onto Windows when you started STAFProc have
> read access to that file?   You may want to make sure by shutting down STAF
> (STAF local SHUTDOWN SHUTDOWN), making sure you are logged on to a Windows
> user that has access to that directory and file, and start STAFProc.
>
> The ability to access a file should not be related to the STAF or STAX
> versions installed.  I have STAF V3.4.7 and STAX V3.5.1 installed on my
> Windows 7 and have no problems accessing files via STAF or via Jython
> within a STAX job (as you are doing).
>
> --------------------------------------------------------------
> Sharon Lucas
> IBM Austin,   *luc...@us.ibm.com* <luc...@us.ibm.com>*
> **(512) 286-7313* <%28512%29%20286-7313> or Tieline 363-7313
>
>
>
>
> From:        Oleg <*oleg.salyak...@gmail.com* <oleg.salyak...@gmail.com>>
> To:        Sharon Lucas/Austin/IBM@IBMUS,
> Cc:        
> *staf-users@lists.sourceforge.net*<staf-users@lists.sourceforge.net>
> Date:        12/08/2011 10:59 AM
> Subject:        Re: [staf-users] Problem with file access on Windows 7
> system
>  ------------------------------
>
>
>
> I see STAFProc.exe process only running on my system -- so I was thinking
> that Jython code runs under its credentials.
>
> The file which I can't open via STAX is available -- I double checked it.
> Interesting, I can open different file in the same directory for writing,
> write something and close it - but I can't find it afterwards! Neither I
> have any erroe displayed.
>
> Could it be problem with versions conflict? I have the latest packages
> installed for Windows.
>
>
> On Thu, Dec 8, 2011 at 4:30 PM, Sharon Lucas 
> <*luc...@us.ibm.com*<luc...@us.ibm.com>>
> wrote:
> The same Python code in a <script> element in my STAX job works fine.
>  Note that it is Jython (running within the STAX Java service) that is
> opening the file, not STAFProc.
>
> Does the user that was logged onto Windows when you started STAFProc have
> read access to that file?
>
> --------------------------------------------------------------
> Sharon Lucas
> IBM Austin,   *luc...@us.ibm.com* <luc...@us.ibm.com>*
> **(512) 286-7313* <%28512%29%20286-7313> or Tieline 363-7313
>
>
>
>
> From:        Oleg <*oleg.salyak...@gmail.com* <oleg.salyak...@gmail.com>>
> To:        
> *staf-users@lists.sourceforge.net*<staf-users@lists.sourceforge.net>,
>
> Date:        12/08/2011 03:49 AM
> Subject:        [staf-users] Problem with file access on Windows 7 system
>  ------------------------------
>
>
>
>
> Hi All.
>
> I'm a very new user in STAX and stuck with the following problem in my
> first exercise:
>
> <script>
>  f = open('C:/Temp/log.txt', 'rb');
>  ...
> </script>
>
> IOError: (2, 'No such file or directory', 'C:/Temp/log.txt')
>
> The file exists and contains data. I checked with 'filemon' that
> STAFProc.exe doesn't even try to open it! Maybe it is a security
> restriction of Jython -- I don't know - the same code works fine when you
> run it via python command line.
>
> Anybody has a clue?
>
> Thanks,
> Oleg.
>
>
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point
> of
> discussion for anyone considering optimizing the pricing and packaging
> model
> of a cloud services business. Read Now!*
> **http://www.accelacomm.com/jaw/sfnl/114/51491232/*<http://www.accelacomm.com/jaw/sfnl/114/51491232/>
> _______________________________________________
> staf-users mailing list*
> **staf-users@lists.sourceforge.net* <staf-users@lists.sourceforge.net>*
> **https://lists.sourceforge.net/lists/listinfo/staf-users*<https://lists.sourceforge.net/lists/listinfo/staf-users>
>
>
>
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point
> of
> discussion for anyone considering optimizing the pricing and packaging
> model
> of a cloud services business. Read Now!*
> **http://www.accelacomm.com/jaw/sfnl/114/51491232/*<http://www.accelacomm.com/jaw/sfnl/114/51491232/>
> _______________________________________________
> staf-users mailing list*
> **staf-users@lists.sourceforge.net* <staf-users@lists.sourceforge.net>*
> **https://lists.sourceforge.net/lists/listinfo/staf-users*<https://lists.sourceforge.net/lists/listinfo/staf-users>
>
>
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point
> of
> discussion for anyone considering optimizing the pricing and packaging
> model
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> _______________________________________________
> staf-users mailing list
> staf-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/staf-users
>
>
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to