Skip to content

NativeBinaryLoader.loadLibrary() fails silently if clean extraction fails #46

Description

@stephengold
        try {
            loader.loadLibrary(LoadingCriterion.CLEAN_EXTRACTION);
        } catch (Exception exception) {
            throw new IllegalStateException(
                    "Failed to load a native library!", exception);
        }

If none of the registered native libraries is loadable (for instance because the libraries with matching predicates are missing from the JAR) the code above does not throw an exception. The failure isn't discovered until the application tries to invoke a native method, at which time a UnsatisfiedLinkError is thrown.

I expected an exception to be thrown during loadLibrary(). Ideally diagnostics should indicate:

  • which libraries it tried to extract and load
    and
  • why each one failed to load.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions