Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 246286

My vmware servlet code is not working

$
0
0

i runed a java code which is perfectly working and vmware server and client are connected and output is displayed.But when i convert it to servlet im geting no clas found exception of Managedentity.Can any one suggest me how to rectify it.Im pasting java code..please help me to convert it to servlet

 

package com.vmware.vim25.mo.samples;

import java.net.URL;
import com.vmware.vim25.*;
import com.vmware.vim25.mo.*;

public class HelloVM 
{
     public static void main(String[] args) throws Exception     {          long start = System.currentTimeMillis();          ServiceInstance si = new ServiceInstance(new URL("https://8.8.8.8/sdk"), "root", "password", true);          long end = System.currentTimeMillis();          System.out.println("time taken:" + (end-start));          Folder rootFolder = si.getRootFolder();          String name = rootFolder.getName();          System.out.println("root:" + name);          ManagedEntity[] mes = new InventoryNavigator(rootFolder).searchManagedEntities("VirtualMachine");          if(mes==null || mes.length ==0)          {               return;          }                    VirtualMachine vm = (VirtualMachine) mes[0];                     VirtualMachineConfigInfo vminfo = vm.getConfig();          VirtualMachineCapability vmc = vm.getCapability();          vm.getResourcePool();          System.out.println("Hello " + vm.getName());          System.out.println("GuestOS: " + vminfo.getGuestFullName());          System.out.println("Multiple snapshot supported: " + vmc.isMultipleSnapshotsSupported());          si.getServerConnection().logout();     }

}

Viewing all articles
Browse latest Browse all 246286

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>