VI SDK 2.5 build 64154 中VMware Java 程序的一..
时间:2009-04-11 来源:us4unixshield
清明一过,下载了一个VMware 的开发包 -VI SDK 2.5 build 64154。 本想编一个统计vmdk 文档的工具,不料 com.vmware.samples.version.getvirtualdiskfiles 有异常错误。
run:
Thu Apr 09 11:33:38 CST 2009 Begin Log.
Started
File not found
Thu Apr 09 11:33:44 CST 2009 Begin Log.
Started
Searching The Datastores using Controller Type Property
Searching The Datastore esxhost01:storage1
Exception in thread "main" java.lang.NullPointerException
at com.vmware.samples.version.getvirtualdiskfiles.GetVirtualDiskFilesV25.getVirtualDiskFiles(GetVirtualDiskFilesV25.java:65)
at com.vmware.samples.version.getvirtualdiskfiles.GetVirtualDiskFiles.displayControllers(GetVirtualDiskFiles.java:82)
at com.vmware.samples.version.getvirtualdiskfiles.GetVirtualDiskFiles.main(GetVirtualDiskFiles.java:100)
Java Result: 1
BUILD SUCCESSFUL (total time: 12 seconds)
我加了一句 if(fileArray == null) continue; 错误就被很容易地修正了。
Thu Apr 09 11:33:38 CST 2009 Begin Log.
Started
File not found
Thu Apr 09 11:33:44 CST 2009 Begin Log.
Started
Searching The Datastores using Controller Type Property
Searching The Datastore esxhost01:storage1
Exception in thread "main" java.lang.NullPointerException
at com.vmware.samples.version.getvirtualdiskfiles.GetVirtualDiskFilesV25.getVirtualDiskFiles(GetVirtualDiskFilesV25.java:65)
at com.vmware.samples.version.getvirtualdiskfiles.GetVirtualDiskFiles.displayControllers(GetVirtualDiskFiles.java:82)
at com.vmware.samples.version.getvirtualdiskfiles.GetVirtualDiskFiles.main(GetVirtualDiskFiles.java:100)
Java Result: 1
BUILD SUCCESSFUL (total time: 12 seconds)
我加了一句 if(fileArray == null) continue; 错误就被很容易地修正了。
相关阅读 更多 +