First, you need to understand that STAX includes and uses Jython 2.1 and 
its libraries to execute Python code in <script> elements, etc.  So, why 
are you appending Python 2.6 to the system path?  Python 2.6 library 
modules are not necessary compatibile with Jython 2.1 (especially if you 
installed the 32-bit version of Python instead of the 64-bit version of 
Python as you're using a 64-bit version of STAF and the JVM).   Also, note 
that Python (aka CPython) is different from Jython as talked about in 
"Appendix F: Jython and CPython Differences" at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_CPythonDiffs. 

You can use the re module provided by Jython 2.1 as part of STAX.  You 
don't change anything in Jython's systme path to use it.  For example, the 
following STAX job runs fine as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">

<stax>

  <defaultcall function="Main"/>
 
  <function name="Main"> 
    <sequence>

      <script>
         import re
         fail = re.search('FAIL', 'FAIL: This test failed')
      </script>

      <log message="1">'fail=%s' % (fail)</log> 

    </sequence>
  </function> 

</stax>

fyi... Jython 2.5.1 became available at the end of last year and we are in 
the process of updating STAX to include and use Jython 2.5.1 instead of 
Jython 2.1 (to be provided in a future release of STAX) once a couple of 
issues in Jython 2.5.1 are resolved.  Jython 2.5.1 is based on Python 2.5.

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




sridhar raman <thot...@yahoo.com> 
02/28/2010 12:33 AM

To
staf-users@lists.sourceforge.net
cc

Subject
[staf-users] AssertionError: SRE module mismatch







Hi,

I am trying to run my job using STAXMon on Ubuntu 2.6.31-14-server x86_64 
GNU/Linux and getting AssertionError: SRE module mismatch. 

# echo $PATH
/usr/local/staf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jython2.5
# echo $PYTHONPATH
/usr/lib/python2.6:/usr/local/staf/lib/python26:/usr/local/staf/lib

I also specified the foll. as someone specified.  Still getting the 
assertionerror.

        <script>
        myPythonDir ='/usr/lib/python2.6'
        pythonpath = sys.path
        sys.path.append(myPythonDir)
        import re
        fail = re.search('FAIL', file_info[1])
        log_msg = 'HOST:%s\n\n%s' % (machine,file_info[1])
      </script>

I have 
Python 2.6
Java 1.6.0_15
STAF - 3.4.0 64-bit

20100227-22:23:21 Start JobID: 2, File: 
/usr/local/staf/tests/client_test_harness.xml, Machine: local://local, 
Function: Main, Args: null, JobName: seltest
20100227-22:23:21 Info Holding block: main
20100227-22:23:23 Info Received RELEASE BLOCK main request
20100227-22:23:23 Info Releasing block: main
20100227-22:23:23 Error STAXPythonEvaluationError signal raised. 
Terminating job.

===== XML Information =====

File: /usr/local/staf/tests/client_test_harness.xml, Machine: 
local://local
Line 22: Error in element type "import".

===== Python Error Information =====

com.ibm.staf.service.stax.STAXPythonEvaluationException:
Traceback (innermost last):
  File "<pyExec string>", line 1, in ?
  File 
"/usr/local/staf/data/STAF/lang/java/shared_jython/2.1-staf-v3.3/Lib/re.py", 
line 7, in ?
  File 
"/usr/local/staf/data/STAF/lang/java/shared_jython/2.1-staf-v3.3/Lib/sre.py", 
line 17, in ?
  File 
"/usr/local/staf/data/STAF/lang/java/shared_jython/2.1-staf-v3.3/Lib/sre_compile.py",
 
line 15, in ?
AssertionError: SRE module mismatch

===== Call Stack for STAX Thread 1 =====

[
  function: Main (Line: 20, File: 
/usr/local/staf/tests/client_test_harness.xml, Machine: local://local)
  sequence: 1/2 (Line: 21, File: 
/usr/local/staf/tests/client_test_harness.xml, Machine: local://local)
]
20100227-22:23:23 Info Terminating block: main
20100227-22:23:23 Status Testcase Totals: Tests: 0, Pass: 0, Fail: 0
20100227-22:23:23 Status Job Result: None
20100227-22:23:23 Stop JobID: 2

Thank you

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to