For vSphere Web Client plugin, I created a java Service , I try to create a datastore in the ESX host using VI JAVA. I included
import com.vmware.vim25.*;
import com.vmware.vim25.mo.*;
files in service implementation and included external JARS to STS environment and created a function to list all hosts:
public List<String> listVcHosts() throws Exception{
ManagedEntity[] hosts = new InventoryNavigator(rootFolder).searchManagedEntities("HostSystem");
List<String> listHosts = new ArrayList<String>();
for( ManagedEntity me : hosts ) {
HostSystem host = (HostSystem) me;
//Adding the list of hosts in List
listHosts.add(host.getName().toString());
}
return listHosts;
}
When I am executing as JAVA Application from STS its working fine without any warnings.
I copied JARS to server/pickup folder and tried to deploy the services in VIRGO.
It's throwing the following exception:
An Import-Package could not be resolved. Caused by missing constraint in bundle <com.xx.xxx.xxxx_1.0.0>
constraint: <Import-Package: com.vmware.vim25.mo; version="0.0.0">