AnsweredAssumed Answered

Troubles with Jython Scripttask

Question asked by benoit1 on Aug 23, 2012
Latest reply on Sep 27, 2012 by frederikheremans1
Hi,

I am trying to define an scripttask in jython. I have put the jython.jar in the classpath. A simple print script works.

My script looks like this :

<script><![CDATA[
from VFR.folder import folder
f=folder('kst')
ret=f.verifyNewMail()
status=ret[0]
onderwerp=status[1]
datum=status[2]
msgid=status[3]
afzender=status[4]]]></script>

I made the 'folder' library which depends on other (python)libraries. Running this script from within an command-line with jython works fine

I tried to run the script from within a shell and everythings works fine.
As I try to run the script in the activiti-engine from a process it returns a SyntaxError

Caused by: javax.script.ScriptException: SyntaxError: mismatched input 'uid' expecting DOUBLESTAR at [536, 38] in file /usr/share/jython/Lib/imapclient/imapclient.py
        at org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:190)
        at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:42)
        at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:79)
        at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:75)
        … 201 more
Caused by: Traceback (most recent call last):
  File "<script>", line 9, in <module>
  File "/usr/share/jython/Lib/imapclient/__init__.py", line 21, in <module>
    from imapclient import *
  File "/usr/share/jython/Lib/imapclient/imapclient.py", line 536
    uid=True, unpack=True)
    ^
SyntaxError: mismatched input 'uid' expecting DOUBLESTAR

        at org.python.core.PyException.fillInStackTrace(PyException.java:70)

Apparantly the ScriptEngine is trying to import all needed libraries and while importing encouter an SyntaxError.

Can someone help me clearing this out ?

Regards,
Benoit

Outcomes