Using the following code, I can connect to the weblogic server. Now I want to get a list of all the applications deployed on the server.
listapplications () from the command line lists the applications, but I cannot store the output in a variable when interpreter.exec (listapplications ()) is executed, because interpreter.exec returns a void. Any ideas on how to keep the list of applications in a collection / array?
Any other alternative or conclusions will also help.
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')"); } }
source share