4
使用以下代碼,我可以連接到weblogic服務器。 現在我想要獲取服務器上部署的所有應用程序的列表。獲取部署在weblogic服務器上的所有應用程序的列表
從命令提示符列表應用程序()列出應用程序,但我執行interpreter.exec(listapplications())時無法將輸出存儲到變量中,因爲interpreter.exec返回void。關於如何將應用程序列表存儲在集合/數組中的任何想法?
任何其他替代或潛在客戶也將有所幫助。
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')");
}
}