Вопрос

I am trying to make a generic script for WebSphere 6.0, 6.1.x and 7 environments. What I need is to read some environment variables of my own that I need to use in the script for which I have been using the os.environ.get['MYVAR']. It works find on a WebSphere 7 and 6.1.x environment. But for a WebSphere 6.0 environment, it gave me the following error :

AttributeError: class 'org.python.modules.os' has no attribute 'environ'

On searching, I found that many of the libraries were introduced as optional libraries in WebSphere 6.1.x onwards and are available under /opt/WebSphere../AppServer/optionalLibraries/jython/Lib but for WebSphere 6.0, it isn't.

I narrowed it down to the javaos.py and copied that to a shared location and passed the location using -wsadmin_classpath option so that it could be found, yet now it gives me another error (possibly its not finding it.)

ImportError: no module named javaos

What I need is to somehow be able to pass some environment variables seemlessly over WebSphere 6.0, 6.1.x and 7.0 or be able to find out if javaos.py has further dependencies that need to be resolved (the hard way).

Это было полезно?

Решение

Edit based on @Husain Khambaty's comment:

1 - Copy the Jython libraries from WebSphere 6.1.x to 6.0 (Directory ex : ${WAS_INSTALL_ROOT}/AppServer/optionalLibraries/jython/Lib). More Info

2 - If you'd like to use any custom location for jython libraries (more suitable for situations where the current WP environment directory can not be changed), then you can tell wsadmin.sh to look for the libraries in the custom location by using the -javaoption "-Dpython.path="

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top