一、服务启动过程异常
部分CPU架构下,出现com.sun.jna加载失败
catalina.out中出现以下类似日志:
Log4j2-TF-1-AsyncLogger [AsyncContext@2ceb80a1]-1 ERROR Recovering from StringBuilderEncoder.encode ('2026-08-28 09:13:28 [ main:16541 ] - [ ERROR ] OSHI 获取网卡信息失败
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at oshi.jna.platform.linux.LinuxLibc.<clinit>(LinuxLibc.java:22) ~[oshi-core-6.4.8.jar:6.4.8]
at oshi.software.os.linux.LinuxOperatingSystem.<clinit>(LinuxOperatingSystem.java:98) ~[oshi-core-6.4.8.jar:6.4.8]
at oshi.hardware.platform.linux.LinuxNetworkIF.queryIfModel(LinuxNetworkIF.java:59) ~[oshi-core-6.解决方案:
在catalina.sh的JAVA_OPTS中增加以下配置项:
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.nio=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED作者:柳杨 创建时间:2026-08-28 09:29
最后编辑:柳杨 更新时间:2026-09-10 20:27
最后编辑:柳杨 更新时间:2026-09-10 20:27
———— 本文档对您有帮助吗?或有错误,恳请 反馈 ————
