AppSync:无法在 Linux 上启动 appsync-cli.sh

Résumé: 问题出在 Java 版本或 Java 类上。

Cet article concerne Cet article ne concerne pas Cet article n’est associé à aucun produit spécifique. Toutes les versions du produit ne sont pas identifiées dans cet article.

Symptômes

运行 AppSync CLI 以类似以下方式登录时:
 
[root@hostname appsync]# ./appsync-cli.sh -login server="FQDN-of-AppSync-Server" port=8445 user=admin password="N@tRealPass1"

系统会返回以下错误:
 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 7 more

Cause

发现主机上安装的是 Java 8,其版本低于所需版本的要求。

Résolution

确保 Linux 主机上安装了支持的 Java 版本。

Informations supplémentaires

请参阅 AppSync 用户指南,查看在 Linux 上运行 AppSync CLI 的所有前提条件。

对于 AppSync 4.2.0.0,《AppSync 4.2 用户指南》的第 21 页要求使用 Java 11,其中指出:     
 
Java Runtime Environment (JRE) 版本 11 — 必须安装并在路径中可用。
 
此外,谨慎的做法是确保 Linux 主机上客户定义的 AppSync CLI 文件夹包含当前正在运行的 AppSync Server 版本中的 CLI。AppSync Server 可能在 AppSync CLI 最初拷贝到 Linux 主机后升级了一次或多次。
 

Produits

AppSync
Propriétés de l’article
Numéro d’article: 000187282
Type d’article: Solution
Dernière modification: 10 sept. 2025
Version:  5
Trouvez des réponses à vos questions auprès d’autres utilisateurs Dell
Services de support
Vérifiez si votre appareil est couvert par les services de support.