【发布时间】:2016-09-03 22:50:49
【问题描述】:
我在使用 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
请帮帮我 谢谢。
【问题讨论】:
-
感谢您的回答,替换为interpreter.exec("listAppRoles( appStripe='obi')");我仍然有与以前相同的错误。我不知道为什么?请帮我。谢谢