在使用wlst时,我遇到了一个从java获取角色的问题。我的代码如下:
import weblogic.management.scripting.WLST;
import weblogic.management.scripting.utils.WLSTInterpreter;
public class JavaTestWLST {
public JavaTestWLST() {
}
public static void main(String[] args) {
try {
WLST.ensureInterpreter();
WLSTInterpreter interpreter = WLST.getWLSTInterpreter();
interpreter.exec("connect('admin','admin','t3://server:7001')");
interpreter.exec("listAppRoles('obi')");
//or interpreter.exec("listAppRoles(appStripe='obi')");
//still eror NameError: listAppRole
}
catch(Exception e){
System.out.println("Exception_111:"+e.toString());
}
}
}我连接成功了,但有一个错误。错误:异常:回溯(最里面的最后一个):文件"",第1行,在?NameError: listAppRoles
请帮帮我谢谢。
发布于 2016-05-15 20:11:34
您要调用的函数模块将接受HashMap对象(键、值对)。arugument必须与key一起传递。就像这个listAppRoles(appStripe="appName")一样,您的代码行可以进行相应的更改,如下所示:
interpreter.exec("listAppRoles( appStripe='obi')"); 发布于 2021-08-21 17:46:34
Weblogic有两个运行wlst的路径。
/$ORACLE_HOME/oracle_common/common/bin /$ORACLE_HOME/wlserver_10.3/common/bin
如果从/oracle_common/common/bin运行wlst.sh,它将成功工作。
步骤: cd /$oracle_HOME/oracle_common/common/bin./wlst.sh
wls:/offline> connect ('weblogic',‘parace1’,'localhost:7001') wls:/bifoundation_domain/serverConfig> listAppRoles(appStripe="obi")
问候
https://stackoverflow.com/questions/37113459
复制相似问题