3

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();
    }
}

}

4

1 に答える 1