Exception threw during connect the VBoxWebSvr
Posted: 28. Oct 2011, 11:23
I try to connect the VBox to manage the VBox by usingJava SOAP API.
My VBox and VBox SDK I use is version is 4.1.4.
But the Exception I can't understand threw in connecting VBoxWebSrv.
The TestVBoxMgr.java is the same as the example of SDK references.
Could anyone help me?
My VBox and VBox SDK I use is version is 4.1.4.
But the Exception I can't understand threw in connecting VBoxWebSrv.
Code: Select all
org.virtualbox_4_1.VBoxException: reasonText argument for createFault was passed NULL
at org.virtualbox_4_1.VirtualBoxManager.connect(VirtualBoxManager.java:181)
at vbox.test.TestVBoxMgr.main(TestVBoxMgr.java:21)
Code: Select all
package vbox.test;
import org.virtualbox_4_1.IVirtualBox;
import org.virtualbox_4_1.VBoxException;
import org.virtualbox_4_1.VirtualBoxManager;
public class TestVBoxMgr {
public static void main(String[] args) {
VirtualBoxManager mgr = VirtualBoxManager.createInstance(null);
boolean ws = true; // or true, if we need the SOAP version
if (ws) {
String url = "http://127.0.0.1:18083";
String user = "test";
String passwd = "test";
try {
mgr.connect(url, user, passwd);
} catch(VBoxException e) {
e.printStackTrace();
}
}
IVirtualBox vbox = mgr.getVBox();
System.out.println("VirtualBox version: " + vbox.getVersion() + "\n");
// get first VM name
String m = vbox.getMachines().get(0).getName();
System.out.println("\nAttempting to start VM ’" + m + "’");
// start it
// mgr.startVm(m, null, 7000);
if (ws)
mgr.disconnect();
mgr.cleanup();
}
}