Running jython scripts in WAS5.1 vs 6.1 - Websphere

This is a discussion on Running jython scripts in WAS5.1 vs 6.1 - Websphere ; I have a few jython scripts that work fine against WAS6.1 environments. When I try to use them in was5.1 they wont work. The scripts use modules from the optionalLibs location that is included with the was6.1 install. /install_root/optionalLibraries/jython/Lib/. This ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Running jython scripts in WAS5.1 vs 6.1

  1. Running jython scripts in WAS5.1 vs 6.1

    I have a few jython scripts that work fine against WAS6.1 environments. When I try to use them in was5.1 they wont work. The scripts use modules from the optionalLibs location that is included with the was6.1 install. /install_root/optionalLibraries/jython/Lib/. This is not included with the instal of was5. Ive copied the same dir into my was5 install roots.



    One of my scripts is importing:



    import threading

    import sys



    This is fine when running against was6, but when running against was5 I get this error:



    jython: Traceback (innermost last):

    File "", line 3, in ?

    ImportError: no module named threading



    So I edit the script to point to the exact path of the module:



    execfile(/install_root/optionalLibraries/jython/Lib/threading.py')



    Now when I execute an error is thrown due to the threading.py not being able to find the traceback module. So I edit the threading.py script and point to the traceback.py script. This problem goes down the line for almost everything in the optionallibs dir. I eventually get to a point where one of the py scripts is importing another script, and it cant find the script even when I point to it... What am I missing here? IBM keeps sending me examples on how to write jython scripts, even though this works fine in was6. Is there anyway to set some type of variable in the setupCmdline script to point to the optionalLibs dir? Are there just some scripts that will not work with was5?

  2. Re: Running jython scripts in WAS5.1 vs 6.1

    Hi, I found the answer to this.



    setting the location to the jython.jar in the optionLibs for the setupCmdline works for was5 apps:



    WAS_CLASSPATH=$INSTACE/properties:"$WAS_HOME"/properties:"$WAS_HOME"/lib/bootst rap.jar:"$WAS_HOME"/lib/j2ee.jar:"

    $WAS_HOME"/lib/lmproxy.jar*:{myPath}/optionalLibraries/jython/jython.jar*

+ Reply to Thread