Author: mladen.turk(a)jboss.com
Date: 2011-12-15 07:19:51 -0500 (Thu, 15 Dec 2011)
New Revision: 1893
Modified:
trunk/java/org/apache/tomcat/jni/Library.java
Log:
Call LibraryLoader before System.loadLibrary. Otherwise dependecies can be auto bound to
libraries inside LD_LIBRARY_PATH instead explicitly from dependecy list
Modified: trunk/java/org/apache/tomcat/jni/Library.java
===================================================================
--- trunk/java/org/apache/tomcat/jni/Library.java 2011-12-15 10:52:00 UTC (rev 1892)
+++ trunk/java/org/apache/tomcat/jni/Library.java 2011-12-15 12:19:51 UTC (rev 1893)
@@ -37,41 +37,40 @@
{
boolean loaded = false;
String err = "";
- for (int i = 0; i < NAMES.length; i++) {
- try {
- System.loadLibrary(NAMES[i]);
- loaded = true;
- }
- catch (Throwable e) {
- if ( i > 0)
- err += ", ";
+ try {
+ LibraryLoader.load(System.getProperty("catalina.home"));
+ loaded = true;
+ }
+ catch (Throwable e) {
+ err += e.getMessage();
+ }
+ if (!loaded) {
+ for (int i = 0; i < NAMES.length; i++) {
+ try {
+ System.loadLibrary(NAMES[i]);
+ loaded = true;
+ }
+ catch (Throwable e) {
+ if ( i > 0)
+ err += ", ";
- String name = System.mapLibraryName(NAMES[i]);
- String path = System.getProperty("java.library.path");
- String sep = System.getProperty("path.separator");
- String [] paths = path.split(sep);
- for (int j=0; j<paths.length; j++) {
- java.io.File fd = new java.io.File(paths[j] +
System.getProperty("file.separator") + name);
- if (fd.exists()) {
- err += "(Error on: " + paths[j] +
System.getProperty("file.separator") + name +")";
+ String name = System.mapLibraryName(NAMES[i]);
+ String path = System.getProperty("java.library.path");
+ String sep = System.getProperty("path.separator");
+ String [] paths = path.split(sep);
+ for (int j=0; j<paths.length; j++) {
+ java.io.File fd = new java.io.File(paths[j] +
System.getProperty("file.separator") + name);
+ if (fd.exists()) {
+ err += "(Error on: " + paths[j] +
System.getProperty("file.separator") + name +")";
+ }
}
+ err += e.getMessage();
}
- err += e.getMessage();
+ if (loaded)
+ break;
}
- if (loaded)
- break;
}
if (!loaded) {
- err += " (LibraryLoader.load()): ";
- try {
- LibraryLoader.load(System.getProperty("catalina.home"));
- loaded = true;
- }
- catch (Throwable e) {
- err += e.getMessage();
- }
- }
- if (!loaded) {
err += "(";
err += System.getProperty("java.library.path");
err += ")";
Show replies by date