Exception in thread "main" java.lang.NullPointerException
at com.vmware.vim25.mo.HostSystem.getHostDatastoreSystem(HostSystem.java:259)
I have a program that enumerates the HostSystems in a datacenter, connecting to a vCenter using vi-java API. When the enumeration hits a 'disconnected' HostSystem, it gets the NullPointerException. The NPE might happen for other methods on HostSystem as well.
Using vijava2120100824.jar.
Throwing a NPE is not good. I think you can work around this issue by checking the state of a HostSystem.
When a HostSytem is disconnected, I can let the method return you a null. But then without checking it, you may have NPE in your code...