我刚刚开始学习 NetApp SDK 并尝试运行 NetApp 创建的第一个示例。我收到以下错误,我不知道为什么与 com/google/common/io/NullOutputStream 有关
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/io/NullOutputStream
at com.netapp.nmsdk.client.ApiTarget$Encoding$1.createApiInvocation(ApiTarget.java:202)
at com.netapp.nmsdk.client.ApiRunner.createApiInvocation(ApiRunner.java:153)
at com.netapp.nmsdk.client.ApiRunner.run(ApiRunner.java:131)
at com.netapp.nmsdk.client.ApiRunner.run(ApiRunner.java:105)
at getSystemMode.getSystemMode.main(getSystemMode.java:30)
Caused by: java.lang.ClassNotFoundException: com.google.common.io.NullOutputStream
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 5 more
package getSystemMode;
import com.netapp.nmsdk.client.ApiRunner;
import com.netapp.nmsdk.client.ApiTarget;
import com.netapp.nmsdk.client.ApiTarget.TargetType;
import com.netapp.nmsdk.ontap.api.system.SystemGetVersionRequest;
import com.netapp.nmsdk.ontap.api.system.SystemGetVersionResponse;
public class getSystemMode {
public static void main(String[] args) {
if (args.length < 3) {
System.err.println("Usage: SystemMode <storage-system> <user> <passwd>");;
System.exit(1);
}
try {
ApiRunner runner = new ApiRunner(ApiTarget.builder()
.withHost(args[0])
.withUserName(args[1])
.withPassword(args[2])
.withTargetType(TargetType.FILER)
.useHttp()
.build());
SystemGetVersionRequest req = new SystemGetVersionRequest();
SystemGetVersionResponse resp = runner.run(req);
if (resp.isClustered() != null && resp.isClustered()) {
System.out.println("The storage system " + args[0] + " is in \"Cluster-Mode\"");
} else {
System.out.println("The storage system " + args[0] + " is in \"7-Mode\"");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}