gpt4 book ai didi

java - 通过java执行OBIEE wlst命令

转载 作者:太空宇宙 更新时间:2023-11-04 12:37:59 27 4
gpt4 key购买 nike

我在使用 wlst 时遇到了从 java 获取 Role 的问题。我的代码如下:

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());
}
}
}

我已成功连接,但出现错误。错误:异常(exception):回溯(最里面的最后):文件“”,第 1 行,在 ?名称错误:listAppRoles

请帮帮我谢谢。

最佳答案

您调用的功能模块将采用 HashMap 对象(键,值对)。参数必须通过 key 传递。像这样 listAppRoles(appStripe="appName")您的代码行可以相应地更改,如下所示:

interpreter.exec("listAppRoles( appStripe='obi')"); 

关于java - 通过java执行OBIEE wlst命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37113459/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com