使用以下代码,我能够连接到weblogic服务器。 现在,我想获得服务器上部署的所有应用程序的列表。在
当我无法从应用程序的输出列表中存储一个变量时,我不能从应用程序中存储一个变量解释器.exec(listapplications())因为解释器.exec返回一个空值。关于如何将应用程序列表存储在集合/数组中有什么想法吗?在
任何其他的选择或线索也会有所帮助。在
import org.python.util.InteractiveInterpreter;
import weblogic.management.scripting.utils.WLSTInterpreter;
public class SampleWLST {
public static void main(String[] args) {
SampleWLST wlstObject = new SampleWLST();
wlstObject.connect();
}
public void connect() {
InteractiveInterpreter interpreter = new WLSTInterpreter();
interpreter.exec("connect('username', 'password', 't3://localhost:8001')");
}
}
我解决了。我通过使用InteractiveInterpreter的setOut方法重定向到一个流来捕获wlst的输出,并编写了一个用Java读取流的扫描器。在
希望这能对其他人有所帮助。在
要获取所有展开的文章,可以使用:
要创建deployer manager,可以使用:
^{pr2}$您将需要的依赖项:
编译(组:'com.oracle.weblogic,名称:“wlfullclient”,版本:“10.3.6.0”,可传递:false)
相关问题 更多 >
编程相关推荐