diff options
-rw-r--r-- | ridljar/com/sun/star/lib/util/NativeLibraryLoader.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java index eb5c6af34e90..d255a71ea5d1 100644 --- a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java +++ b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java @@ -21,6 +21,7 @@ package com.sun.star.lib.util; import java.io.File; import java.net.URL; import java.net.URLClassLoader; +import com.sun.star.lib.unoloader.UnoClassLoader; /** * Helper functions to locate and load native files. @@ -35,6 +36,14 @@ import java.net.URLClassLoader; * algorithm.</p> */ public final class NativeLibraryLoader { + static { + // if it's some other class loader, then resolving the symbol + // Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call in + // java_uno will not work and result in UnsatisfiedLinkError + if (!(NativeLibraryLoader.class.getClassLoader() instanceof com.sun.star.lib.unoloader.UnoClassLoader)) { + System.err.println("warning: com.sun.star.lib.util.NativeLibraryLoader must be loaded by com.sun.star.lib.unoloader.UnoClassLoader for java_uno bridge to work (not a problem if this is using Java remote bridge or unit test)"); + } + } /** * Load a system library, using a given class loader to locate the library. * |