python - 在 WLST 中导入 python 模块(weblogic 脚本工具)
问题描述
我需要在 WLST 中导入 python 模块。例如,我需要 WLST 中的“信号”模块来编写超时函数。所以我问你怎么做。
环境:Oracle Linux 6、Oracle Weblogic 11
此外,我让您查看 WLST 中的一段代码,其中我需要一个超时函数,以及它引发异常的原因:
import sys
import os
from java.lang import System
import getopt
import time as systime
[...]
def _startServer(ServerName):
while(true)
try:
cd('domainRuntime:/ServerLifeCycleRuntimes/'+ServerName);
cmo.start();
state=_serverstatus(ServerName);
while (state!='RUNNING'):
state=_serverstatus(ServerName);
java.lang.Thread.sleep(5000);
#=================
# timeout function
#=================
except:
print 'Error in getting current status of ' +ServerName+ '\n';
print 'Please check logged in user has full access to complete the start operation on ' +ServerName+ '\n';
os.popen('sh /home/oracle/scripts/logAnalytics.sh')
systime.sleep(60)
exit()
break
[...]
解决方案
推荐阅读
- android - 28.0.3 aapt.exe'' 以非零退出值 1 结束
- domain-driven-design - 从实体创建 VO
- azure-functions - Azure 函数未登录到 Application Insights
- javascript - 如何与使用从客户端传递到服务器的 ActionCable 参数的通道保持连接?
- mysql - 我的图像表有一个类别字段。我应该在该字段中有 ID 或类别的名称吗?
- php - 向客户添加 PDF - laravel 5.7
- php - PHP查询将多个随机长度数组写入MySQL数据库中的同一个表,而不会出现“未定义的偏移量”错误
- websocket - MicroFrontends 到 MicroService 后端通过单通道/websocket 的通信模式
- arrays - 如何使用 VueJS 将一组对象中的一个对象替换为另一个对象?
- c# - .NET Core 中 WebRequest 的重定向