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

UnsatisfiedLinkError GetIfEntry2 on winxp #315

Closed
jimbostimilon opened this issue Feb 15, 2017 · 5 comments
Closed

UnsatisfiedLinkError GetIfEntry2 on winxp #315

jimbostimilon opened this issue Feb 15, 2017 · 5 comments
Assignees
Labels
confirmed bug Confirmed bugs. Highest priority to fix.
Milestone

Comments

@jimbostimilon
Copy link

jimbostimilon commented Feb 15, 2017

I know Winxp is obsolete but...

I'm seeing this error on Winxp 32bit when calling SystemInfo in OSHI 3.2 and 3.3, but I don't see the error in 3.1.1 and below. Maybe related to #243: Make Windows network statistics 64-bit ?

I'm using JNA 4.2.2

Exception in thread "pool-9-thread-1" java.lang.UnsatisfiedLinkError: Error looking up function 'GetIfEntry2': The specified procedure could not be found.

at com.sun.jna.Function.<init>(Function.java:212)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:541)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:518)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:504)
at com.sun.jna.Library$Handler.invoke(Library.java:220)
at com.sun.proxy.$Proxy7.GetIfEntry2(Unknown Source)
at oshi.hardware.platform.windows.WindowsNetworks.updateNetworkStats(WindowsNetworks.java:51)
at oshi.hardware.NetworkIF.updateNetworkStats(NetworkIF.java:274)
at oshi.hardware.common.AbstractNetworks.getNetworks(AbstractNetworks.java:57)
at oshi.hardware.platform.windows.WindowsHardwareAbstractionLayer.getNetworkIFs(WindowsHardwareAbstractionLayer.java:97)
at oshi.json.hardware.impl.HardwareAbstractionLayerImpl.getNetworkIFs(HardwareAbstractionLayerImpl.java:133)
at oshi.json.hardware.impl.HardwareAbstractionLayerImpl.toJSON(HardwareAbstractionLayerImpl.java:213)
at oshi.json.SystemInfo.toJSON(SystemInfo.java:111)
@dbwiddis
Copy link
Member

The GetIfEntry2 function requires Vista or later. And you're correct, the change in #243 is the 'culprit'.

It's probably easy to put in a Windows version check to use the 32-bit statistics on pre-Vista.

@dbwiddis dbwiddis self-assigned this Feb 15, 2017
@dbwiddis dbwiddis added the confirmed bug Confirmed bugs. Highest priority to fix. label Feb 15, 2017
@dbwiddis dbwiddis added this to the 3.4.0 milestone Feb 15, 2017
@jimbostimilon
Copy link
Author

I did see another UnsatisfiedLinkError with Winxp-32 as well, but haven't traced it back to a particular version yet. I just disabled uptime since I don't need it.

Exception in thread "pool-9-thread-1" java.lang.UnsatisfiedLinkError: Error looking up function 'GetTickCount64': The specified procedure could not be found.

at com.sun.jna.Function.<init>(Function.java:212)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:541)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:518)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:504)
at com.sun.jna.Library$Handler.invoke(Library.java:220)
at com.sun.proxy.$Proxy1.GetTickCount64(Unknown Source)
at oshi.hardware.platform.windows.WindowsCentralProcessor.getSystemUptime(WindowsCentralProcessor.java:221)
at oshi.json.hardware.impl.CentralProcessorImpl.getSystemUptime(CentralProcessorImpl.java:246)
at oshi.json.hardware.impl.CentralProcessorImpl.toJSON(CentralProcessorImpl.java:351)
at oshi.json.hardware.impl.HardwareAbstractionLayerImpl.toJSON(HardwareAbstractionLayerImpl.java:191)
at oshi.json.SystemInfo.toJSON(SystemInfo.java:111)
at oshi.json.json.AbstractOshiJsonObject.toJSON(AbstractOshiJsonObject.java:70)

@dbwiddis
Copy link
Member

Thanks! This stack trace is enough to go on.

@dbwiddis
Copy link
Member

Snapshot is updated with fixes in #316. Can you test it out and see if it solves both problems above?

@jimbostimilon
Copy link
Author

Looks good to me. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug Confirmed bugs. Highest priority to fix.
Projects
None yet
Development

No branches or pull requests

2 participants