本文介绍了在没有Weblogic的WLST的情况下调用Jython的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用安装了Weblogic 9.21的AIX机器,并且在安装(WLST)的过程中还安装了jython.
I'm using an AIX machine which has Weblogic 9.21 installed and it also has jython as part of its installation (WLST).
有没有一种方法可以运行jython代码而不必先初始化WLST?
Is there a way to run jython code without having to initialize the WLST first?
如果有任何想法,我也有以下罐子:
I have the following jars too if they bring in any ideas:
['.', '/opt/weblogic921/weblogic92/common/lib/jython.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/server/lib/weblogic.jar', '/opt/weblogic921/weblogic92/common/wlst/modules/jython-modules.jar/Lib', '/opt/weblogic921/weblogic92/common/wlst', '/opt/weblogic921/weblogic92/common/wlst/lib', '/opt/weblogic921/weblogic92/common/wlst/modules']
现在我正在使用以下命令调用jython代码:
Right now I'm invoking the jython code using:
java -cp /opt/weblogic921/weblogic92/server/lib/weblogic.jar weblogic.WLST file.py
推荐答案
在shell脚本中粘贴以下代码并说jythonExec.sh
并使用它
Paste below code in a shell script say jythonExec.sh
and use it
示例用法:/bin/bash jythonExec.sh file.py
#!/bin/bash
jythonJarLoc=/opt/weblogic921/weblogic92/common/lib/jython.jar
javaLoc=/usr/bin/java
pythonCacheDir=/tmp/pythonCacheDir
if [ ! -f ${jythonJarLoc} ]; then
jythonJarLoc=/opt/weblogic921/weblogic92/server/lib/weblogic.jar
fi
${javaLoc} -cp ${jythonJarLoc} -Dpython.cachedir=${pythonCacheDir} org.python.util.jython $@
这篇关于在没有Weblogic的WLST的情况下调用Jython的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!