When trying to start the Spectrum Data Publisher it fails to start with the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at oshi.jna.platform.linux.LinuxLibc.<clinit>(LinuxLibc.java:22)
at oshi.software.os.linux.LinuxOperatingSystem.<clinit>(LinuxOperatingSystem.java:97)
at oshi.SystemInfo.createOperatingSystem(SystemInfo.java:85)
at oshi.util.Memoizer$1.get(Memoizer.java:61)
at oshi.SystemInfo.getOperatingSystem(SystemInfo.java:76)
at com.broadcom.datastore.supportability.monitor.ProcessMonitor.<init>(ProcessMonitor.java:93)
at com.broadcom.datastore.supportability.SupportabilityProperties.lambda$0(SupportabilityProperties.java:51)
at com.broadcom.datastore.supportability.SupportabilityManagerImpl.<init>(SupportabilityManagerImpl.java:133)
at com.ca.spectrum.spub.client.DXOIReactiveClient.initialize(DXOIReactiveClient.java:61)
at com.ca.spectrum.spub.client.DXOIReactiveClient.<init>(DXOIReactiveClient.java:48)
at com.ca.spectrum.spub.metrics.reactor.NassReactiveClientPoller.<init>(NassReactiveClientPoller.java:41)
at com.ca.spectrum.spub.metrics.MetricsManager.<init>(MetricsManager.java:35)
at com.ca.spectrum.spub.metrics.MetricsManager.<clinit>(MetricsManager.java:22)
at com.ca.spectrum.spub.client.ConnectionValidator.validateNass(ConnectionValidator.java:196)
at com.ca.spectrum.spub.client.ConnectionValidator.validateAll(ConnectionValidator.java:104)
at com.ca.spectrum.spub.security.PasswordManager.validateConnections(PasswordManager.java:80)
at com.ca.spectrum.spub.security.PasswordManager.main(PasswordManager.java:157)
DX NetOps Spectrum: 24.3
This is the root error that indicates the problem: (This came in the console when running run.sh)
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
Turns out this is related to the jna-5.13.jar file - it tried to extract a library into a tmp directory (in this case underneath /home/spectrum/....)
We added this debug flag to the JVM -Djna.debug_load=true
and it produced this output
INFO: Looking in classpath from jdk.internal.loader.ClassLoaders$AppClassLoader@2c34f934 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Aug 28, 2025 8:14:47 AM com.sun.jna.Native extractFromResourcePath
INFO: Found library resource at jar:file:/opt/spectrum/datapubv23/SpectrumDataPublisher/lib/jna-5.13.0.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Aug 28, 2025 8:14:47 AM com.sun.jna.Native extractFromResourcePath
INFO: Extracting library to /home/spectrum/.cache/JNA/temp/jna17690126734206817563.tmp
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
By manually extracting the .so file and through some AI searching found that the problem was that the /home directory had a "noexec" flag set on it in the fstab... therefore we CANNOT extract the .so into that filesystem - the O/S refuses to execute it.
We solved the problem by creating a tmp directory underneath /opt/SpectrumDataPublisher/lib and setting the following environmental variable in run.sh in the APP_PARAMS
-Djna.tmpdir=<SDPHOME>/lib/tmp