Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JNA 1.15.0 to make it compatible with latest OSHI 6.6.5 #1449

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

mwithi
Copy link
Member

@mwithi mwithi commented Nov 13, 2024

With JNA 1.14.0 this test is failing on Windows:

	@Test
	void testRetrieveData() throws Exception {
		HardwareDataCollector hardwareDataCollector = new HardwareDataCollector();
		Map<String, String> data = hardwareDataCollector.retrieveData();
		assertThat(data).isNotNull();
		assertThat(data).isNotEmpty();
		assertThat(data).hasSize(9);
	}

with error:

java.lang.NoSuchMethodError: 'boolean oshi.jna.platform.windows.Kernel32.IsProcessorFeaturePresent(int)'
	at oshi.hardware.platform.windows.WindowsCentralProcessor.lambda$initProcessorCounts$0(WindowsCentralProcessor.java:200)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at oshi.hardware.platform.windows.WindowsCentralProcessor.initProcessorCounts(WindowsCentralProcessor.java:201)
	at oshi.hardware.common.AbstractCentralProcessor.<init>(AbstractCentralProcessor.java:68)
	at oshi.hardware.platform.windows.WindowsCentralProcessor.<init>(WindowsCentralProcessor.java:60)
	at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.createProcessor(WindowsHardwareAbstractionLayer.java:42)
	at oshi.util.Memoizer$1.get(Memoizer.java:61)
	at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:48)
	at org.isf.telemetry.envdatacollector.collectors.HardwareDataCollector.retrieveData(HardwareDataCollector.java:65)
	at org.isf.telemetry.envdatacollector.collectors.TestHardwareDataCollector.testRetrieveData(TestHardwareDataCollector.java:49)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

@mwithi mwithi requested a review from dbmalkovsky November 13, 2024 14:50
Copy link
Collaborator

@dbmalkovsky dbmalkovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dbmalkovsky dbmalkovsky merged commit 846a841 into develop Nov 13, 2024
2 checks passed
@dbmalkovsky dbmalkovsky deleted the mwithi_update_jna branch November 13, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants