Confusing error message when secondary .so file not loaded

Open
#655 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Start by tracing the native library loading path using jna.library.path and the UnsatisfiedLinkError reported for myapp.jar with libx.so and liby.so. Reproduce the case where libx.so loads but a call reaches liby.so, then verify whether the final message identifies the library that actually failed to load.

Written by the indexing model from the issue text.

Description

I have two sharable object files, libx.so and liby.so, both in the same dir as myapp.jar.
I have set jna.library.path= to that dir.
My java code loads 'a' successfully, and can call a method in it.
But if that method calls a method in b, I get an UnsatisfiedLinkError with the message:
'Unable to load library 'example': Native library (linux-x86-64/libx.so) not found in resource path ([file:/this/that/myapp.jar])'.
I have a hunch that there's no problem to load libx.so, the problem is with liby.so.
The exception message is most probably misleading.
By the way, libx.so is NOT in any subdir linux-x86-64.

Please have a check and see if the exception message can be made more correct and informative.

Dominant language
Java
Stars
8.9k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from java-native-access/jna

All issues in java-native-access/jna

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.