View | Details | Raw Unified | Return to bug 57021
Collapse All | Expand All

(-)java/org/apache/catalina/core/AprLifecycleListener.java (-2 / +19 lines)
Lines 29-34 Link Here
29
import org.apache.juli.logging.Log;
29
import org.apache.juli.logging.Log;
30
import org.apache.juli.logging.LogFactory;
30
import org.apache.juli.logging.LogFactory;
31
import org.apache.tomcat.jni.Library;
31
import org.apache.tomcat.jni.Library;
32
import org.apache.tomcat.jni.LibraryNotFoundError;
32
import org.apache.tomcat.jni.SSL;
33
import org.apache.tomcat.jni.SSL;
33
import org.apache.tomcat.util.ExceptionUtils;
34
import org.apache.tomcat.util.ExceptionUtils;
34
import org.apache.tomcat.util.res.StringManager;
35
import org.apache.tomcat.util.res.StringManager;
Lines 208-215 Link Here
208
        } catch (Throwable t) {
209
        } catch (Throwable t) {
209
            t = ExceptionUtils.unwrapInvocationTargetException(t);
210
            t = ExceptionUtils.unwrapInvocationTargetException(t);
210
            ExceptionUtils.handleThrowable(t);
211
            ExceptionUtils.handleThrowable(t);
211
            initInfoLogMessages.add(sm.getString("aprListener.aprInit",
212
            
212
                    System.getProperty("java.library.path")));
213
            if(t instanceof LibraryNotFoundError){
214
            	log.warn(sm.getString("aprListener.aprNotFound", ((LibraryNotFoundError) t).getName(), System.getProperty("java.library.path"))); 
215
            	if(log.isDebugEnabled()) {
216
            		 log.error(sm.getString("aprListener.aprNotFound", ((LibraryNotFoundError) t).getName(), System.getProperty("java.library.path")), t);
217
            	 }
218
            }            
219
            else if(t instanceof UnsatisfiedLinkError){
220
            	log.warn(sm.getString("aprListener.aprFailedToLoad", System.getProperty("java.library.path"))); 
221
            	if(log.isDebugEnabled()) {
222
            		 log.error(sm.getString("aprListener.aprFailedToLoad", System.getProperty("java.library.path")), t);
223
            	 }
224
            }            
225
            else{
226
                initInfoLogMessages.add(sm.getString("aprListener.aprInit",
227
                        System.getProperty("java.library.path")));
228
            }
229
            
213
            return;
230
            return;
214
        }
231
        }
215
        if (apver < rqver) {
232
        if (apver < rqver) {
(-)java/org/apache/catalina/core/LocalStrings.properties (+2 lines)
Lines 51-56 Link Here
51
applicationServletRegistration.setServletSecurity.ise=Security constraints can't be added to servlet [{0}] deployed to context with name [{1}] as the context has already been initialised
51
applicationServletRegistration.setServletSecurity.ise=Security constraints can't be added to servlet [{0}] deployed to context with name [{1}] as the context has already been initialised
52
applicationSessionCookieConfig.ise=Property {0} can not be added to SessionCookieConfig for context {1} as the context has been initialised
52
applicationSessionCookieConfig.ise=Property {0} can not be added to SessionCookieConfig for context {1} as the context has been initialised
53
aprListener.aprInit=The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: {0}
53
aprListener.aprInit=The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: {0}
54
aprListener.aprNotFound=The APR based Apache Tomcat Native library {0} which allows optimal performance in production environments was not found on the java.library.path: {1}
55
aprListener.aprFailedToLoad=Failed to load The APR based Apache Tomcat Native library which allows optimal performance in production environments
54
aprListener.tcnInvalid=An incompatible version {0} of the APR based Apache Tomcat Native library is installed, while Tomcat requires version {1}
56
aprListener.tcnInvalid=An incompatible version {0} of the APR based Apache Tomcat Native library is installed, while Tomcat requires version {1}
55
aprListener.tcnVersion=An older version {0} of the APR based Apache Tomcat Native library is installed, while Tomcat recommends a minimum version of {1}
57
aprListener.tcnVersion=An older version {0} of the APR based Apache Tomcat Native library is installed, while Tomcat recommends a minimum version of {1}
56
aprListener.aprDestroy=Failed shutdown of APR based Apache Tomcat Native library
58
aprListener.aprDestroy=Failed shutdown of APR based Apache Tomcat Native library
(-)java/org/apache/tomcat/jni/Library.java (-3 / +19 lines)
Lines 18-23 Link Here
18
package org.apache.tomcat.jni;
18
package org.apache.tomcat.jni;
19
19
20
import java.io.File;
20
import java.io.File;
21
import java.io.FileNotFoundException;
21
22
22
/** Library
23
/** Library
23
 *
24
 *
Lines 49-70 Link Here
49
                if (t instanceof VirtualMachineError) {
50
                if (t instanceof VirtualMachineError) {
50
                    throw (VirtualMachineError) t;
51
                    throw (VirtualMachineError) t;
51
                }
52
                }
53
                
52
                String name = System.mapLibraryName(NAMES[i]);
54
                String name = System.mapLibraryName(NAMES[i]);
53
                String path = System.getProperty("java.library.path");
55
                String path = System.getProperty("java.library.path");
54
                String [] paths = path.split(File.pathSeparator);
56
                String [] paths = path.split(File.pathSeparator);
55
                for (int j=0; j<paths.length; j++) {
57
                for (int j=0; j<paths.length; j++) {
56
                    java.io.File fd = new java.io.File(paths[j] , name);
58
                    java.io.File fd = new java.io.File(paths[j] , name);
59
                                    
60
                    //If dll exists,
57
                    if (fd.exists()) {
61
                    if (fd.exists()) {
58
                        t.printStackTrace();
62
                        throw t;
63
                    	//Commented as it will not block next DLL from loading.
64
                    	//t.printStackTrace();                       
59
                    }
65
                    }
60
                }
66
                }
61
                if ( i > 0)
67
                
68
                err.append(t.getMessage());
69
            	err.append('(');
70
                err.append(System.getProperty("java.library.path"));
71
                err.append(')');
72
            	throw new LibraryNotFoundError(name, err.toString());
73
            	
74
            	//Commenetd as part of fix
75
                /* if ( i > 0)
62
                    err.append(", ");
76
                    err.append(", ");
63
                err.append(t.getMessage());
77
                err.append(t.getMessage());*/
64
            }
78
            }
65
            if (loaded)
79
            if (loaded)
66
                break;
80
                break;
67
        }
81
        }
82
        
83
        
68
        if (!loaded) {
84
        if (!loaded) {
69
            err.append('(');
85
            err.append('(');
70
            err.append(System.getProperty("java.library.path"));
86
            err.append(System.getProperty("java.library.path"));
(-)java/org/apache/tomcat/jni/LibraryNotFoundError.java (+16 lines)
Line 0 Link Here
1
package org.apache.tomcat.jni;
2
3
public class LibraryNotFoundError extends UnsatisfiedLinkError{
4
5
	String nameOfTheLibrary = null;
6
	public LibraryNotFoundError(String name, String errorMessage){
7
		super(errorMessage);
8
		nameOfTheLibrary = name;
9
		
10
	}
11
	
12
	public String getName(){
13
		return nameOfTheLibrary;
14
	}
15
	
16
}

Return to bug 57021