You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could be fixed in the library using something like:
/** * Workaround for unfortunate system class loader usage. * * @see https://github.com/jnr/jnr-ffi/issues/51 */@SneakyThrowsprivatevoidpatchFfi() {
ClosureManagerclosureManager = NativeRuntime.getInstance().getClosureManager();
// Get inner class loadervalclassLoader = findField(closureManager.getClass(), "classLoader");
classLoader.setAccessible(true);
valasmClassLoader = classLoader.get(closureManager);
// Update to use context class loader over the default system class loadervalparent = findField(asmClassLoader.getClass(), "parent");
parent.setAccessible(true);
parent.set(asmClassLoader, Thread.currentThread().getContextClassLoader());
}
Thoughts?
The text was updated successfully, but these errors were encountered:
If there is a non-standard non-system classloader in play, this causes issues. In my case, I'm using a classloader that knows how to read from nested jars. It is good practice to use context classloader over system for this reason
See jnr/jnr-ffi#51 for the issue.
This could be fixed in the library using something like:
Thoughts?
The text was updated successfully, but these errors were encountered: