简体   繁体   English

weblogic wlst控制台未显示环境变量的完整列表

[英]weblogic wlst console does not show full list of environment variables

I am running Ubuntu 18.04.1 LTS 我正在运行Ubuntu 18.04.1 LTS

When running the wlst.sh within my weblogic server, I am trying to get the value of a env var but the value is not there. wlst.sh服务器中运行wlst.sh ,我试图获取env var的值,但该值不存在。 However when checking the dict os.env it only contains two env vars (it is missing most of them, eg JAVA_HOME). 但是,在检查dict os.env它仅包含两个env变量(缺少大多数变量,例如JAVA_HOME)。 This is what the sequence of actions I am doing: 这是我正在执行的操作序列:

$export MY_VAR=123
$$MW_HOME/oracle_common/common/bin/wlst.sh
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option 
MaxPermSize=256m; support was removed in 8.0

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> print str(os.environ)
{'FZF_DEFAULT_OPTIONS': '--extended\n\t--color 
fg:240,bg:230,hl:33,fg+:241,bg+:221,hl+:33\n\t--color 
info:33,prompt:33,pointer:166,marker:166,spinner:33', 
'VIRTUALENVWRAPPER_WORKON_CD': '1'}

My exported var and many others are no there. 我导出的var和许多其他变量都不在那里。

Running the same in a fresh new intallation retrieves the full set of env vars. 在全新的安装中运行相同的命令将检索完整的环境变量。

If I run it within my python (2.7) console it does retrieve the full set too. 如果我在python(2.7)控制台中运行它,它也会检索完整集。

I have finally track this issue down. 我终于找到了这个问题。 In my .bashrc I have a environment var define over two lines: 在我的.bashrc中,我在两行中定义了一个环境变量:

export MY_VAR="bla_bla
"

That cause the jython interpreter(version 2.2.1) within weblogic to load only the environment vars until it found that one, that's why the dic os.environ was partially loaded. 这导致weblogic中的jython解释器(版本2.2.1)仅加载环境var,直到发现其中一个,这就是dic os.environ被部分加载的原因。

Thats, however, handle fine and all env vars were loaded within my python terminal either 2.7 or 3.5 多数民众赞成,但是,可以很好地处理和所有环境变量都加载到我的python终端2.7或3.5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM