From b05f716cbcbc379588050c8f3d91579b3a14ec88 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 1 Oct 2013 15:34:05 +0200 Subject: Bug 845: Fix JNILibLoaderBase.addNativeJarLibsImpl(..) fat-jar case. Always use the jar-basename when calling TempJarCache.addNativeLibs(..), otherwise it is mapped and loaded multiple times leading to different native libraries. Simplify addNativeJarLibsImpl(..) argument semantics by passing complete jarBasename and nativeJarBasename (w/ suffix). Added manual test scripts validating [gluegen + jogl] usage with multi (Bug 843) and fat (Bug 845) jar configurations. --- src/java/com/jogamp/common/util/cache/TempJarCache.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/java/com/jogamp/common/util/cache') diff --git a/src/java/com/jogamp/common/util/cache/TempJarCache.java b/src/java/com/jogamp/common/util/cache/TempJarCache.java index e2a33e0..ecf6e56 100644 --- a/src/java/com/jogamp/common/util/cache/TempJarCache.java +++ b/src/java/com/jogamp/common/util/cache/TempJarCache.java @@ -210,13 +210,16 @@ public class TempJarCache { nativeLibJars.put(jarURI, LoadState.LOOKED_UP); final JarFile jarFile = JarUtil.getJarFile(jarURI); if(DEBUG) { - System.err.println("TempJarCache: addNativeLibs: "+jarURI+": nativeJar "+jarFile.getName()); + System.err.println("TempJarCache: addNativeLibs: "+jarURI+": nativeJar "+jarFile.getName()+" (NEW)"); } validateCertificates(certClass, jarFile); final int num = JarUtil.extract(tmpFileCache.getTempDir(), nativeLibMap, jarFile, nativeLibraryPath, true, false, false); nativeLibJars.put(jarURI, LoadState.LOADED); return num > 0; } else if( testLoadState(nativeLibJarsLS, LoadState.LOADED) ) { + if(DEBUG) { + System.err.println("TempJarCache: addNativeLibs: "+jarURI+": nativeJar "+jarURI+" (REUSE)"); + } return true; } throw new IOException("TempJarCache: addNativeLibs: "+jarURI+", previous load attempt failed"); -- cgit v1.2.3