This is the code im running, its a pretty straightforward example of instantiating an IMachine object by machine name, and attempting to take a snapshot of it.
Code: Select all
public String takeVMSnapshot(VirtualBoxManager vboxMgr, IVirtualBox vBox, String vmName, String snapshotName) {
String returnValue = "";
try {
IMachine machine = vBox.findMachine(vmName);
IProgress progress = machine.takeSnapshot(snapshotName, "", true, null);
progress.waitForCompletion(-1);
returnValue = "Successfully created snapshot " + snapshotName + " on VM: " + vmName;
} catch (VBoxException e) {
e.printStackTrace();
returnValue = "Attempted to create snapshot " + snapshotName + " on VM: " + vmName + " but the method takeVMSnapshot failed. Here's the exception: " + e.getMessage();
}
return returnValue;
}
Code: Select all
org.virtualbox_5_0.VBoxException: VirtualBox error: rc=0x80004001 Method Machine::takeSnapshot is not implemented (0x80004001)
at org.virtualbox_5_0.IMachine.takeSnapshot(IMachine.java:6430)
at VirtualBoxService.takeVMSnapshot(VirtualBoxService.java:338)
at VirtualBoxService.main(VirtualBoxService.java:615)
Caused by: org.virtualbox_5_0.jaxws.RuntimeFaultMsg: VirtualBox error: rc=0x80004001 Method Machine::takeSnapshot is not implemented (0x80004001)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:136)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
at com.sun.proxy.$Proxy24.iMachineTakeSnapshot(Unknown Source)
at org.virtualbox_5_0.IMachine.takeSnapshot(IMachine.java:6420)
... 2 more
Again, im running Both VirtualBox 5.0.14 for windows, and am running my java code using the vboxjws.jar included in the latest 5.0.14 SDK. Also, i have attached a screenshot of the VBoxWebSrv.exe output from my running web service instance on my server when the takeSnapshot request comes in.
I attempted to take a snapshot using a VBoxManage direct CLI call for the same VM in question, and the worked as expected.
Can anyone explain what would cause this exception?