Skip to content

Bump JNA version from 5.13.0 to 5.18.1 for Oshi monitor#18848

Merged
abhishekrb19 merged 2 commits into
masterfrom
oshi_dep_fixup
Dec 17, 2025
Merged

Bump JNA version from 5.13.0 to 5.18.1 for Oshi monitor#18848
abhishekrb19 merged 2 commits into
masterfrom
oshi_dep_fixup

Conversation

@abhishekrb19

Copy link
Copy Markdown
Contributor

#18839 updated the oshi-core dependency from 6.4.4 to 6.9.1.

Running Druid locally on macOS with the Oshi monitor enabled causes service startup to fail with the following error:

Caused by: java.lang.NoClassDefFoundError: com/sun/jna/platform/mac/CoreFoundation$CFLocale
	at oshi.software.os.mac.MacOperatingSystem.<init>(MacOperatingSystem.java:58)
	at oshi.software.os.mac.MacOperatingSystemJNA.<init>(MacOperatingSystemJNA.java:54)
	at oshi.SystemInfo.createOperatingSystem(SystemInfo.java:87)
	at oshi.util.Memoizer$1.get(Memoizer.java:65)
	at oshi.SystemInfo.getOperatingSystem(SystemInfo.java:76)
	at org.apache.druid.java.util.metrics.OshiSysMonitor.<init>(OshiSysMonitor.java:102)
	at org.apache.druid.java.util.metrics.OshiSysMonitor.<init>(OshiSysMonitor.java:90)

Newer versions of OSHI require a corresponding bump to the JNA dependencies, so update the JNA and JNA-platform dependencies accordingly

Added a unit test that fails locally with the same error when the JNA versions are not bumped.

Release note

Bump net.java.dev.jna and net.java.dev.jna versions from 5.13.0 to 5.18.1 for Oshi monitor.

This PR has:

  • been self-reviewed.
  • a release note entry in the PR description.
  • added or updated version, license, or notice information in licenses.yaml
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

Newer versions of Oshi requires a bump in JNA dependency too. Without that, running quickstart
with oshi sys monitor will fail processes with the following error:

Caused by: java.lang.NoClassDefFoundError: com/sun/jna/platform/mac/CoreFoundation$CFLocale
	at oshi.software.os.mac.MacOperatingSystem.<init>(MacOperatingSystem.java:58)
	at oshi.software.os.mac.MacOperatingSystemJNA.<init>(MacOperatingSystemJNA.java:54)
	at oshi.SystemInfo.createOperatingSystem(SystemInfo.java:87)
	at oshi.util.Memoizer$1.get(Memoizer.java:65)
	at oshi.SystemInfo.getOperatingSystem(SystemInfo.java:76)
	at org.apache.druid.java.util.metrics.OshiSysMonitor.<init>(OshiSysMonitor.java:102)
	at org.apache.druid.java.util.metrics.OshiSysMonitor.<init>(OshiSysMonitor.java:90)

Adds a unit test that fails locally with the same error without the jna dependencies bumped up.
@abhishekrb19

Copy link
Copy Markdown
Contributor Author

Thanks, @jtuglu1!

@abhishekrb19
abhishekrb19 merged commit 425b906 into master Dec 17, 2025
55 checks passed
@abhishekrb19
abhishekrb19 deleted the oshi_dep_fixup branch December 17, 2025 20:52
@kgyrtkirk kgyrtkirk added this to the 36.0.0 milestone Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants