costin 02/04/15 17:21:37 Modified: jk/java/org/apache/jk/apr AprImpl.java jk/java/org/apache/jk/common ChannelUn.java Log: Gracefully deal with wrong LD_LIBRARY_PATH or unavailable libs. If libapr.so and libjkjni.so are found in the path ( or /usr/lib or ld.so.conf ) - the unix channel will be enabled. If not - we'll just report and go on. Revision Changes Path 1.7 +2 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java Index: AprImpl.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- AprImpl.java 16 Apr 2002 00:01:33 -0000 1.6 +++ AprImpl.java 16 Apr 2002 00:21:37 -0000 1.7 @@ -80,7 +80,7 @@ * Of course, this can change to System.load() and putting the * libs in LD_LIBRARY_PATH. */ - public void loadNative() { + public void loadNative() throws Throwable { if( aprHome==null ) aprHome=baseDir; if( aprHome==null ) { @@ -90,7 +90,7 @@ System.loadLibrary( "jkjni" ); } catch( Throwable ex ) { ok=false; - ex.printStackTrace(); + throw ex; } } else { File dir=new File(aprHome); 1.11 +7 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java Index: ChannelUn.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ChannelUn.java 16 Apr 2002 00:04:42 -0000 1.10 +++ ChannelUn.java 16 Apr 2002 00:21:37 -0000 1.11 @@ -137,10 +137,14 @@ if( aprHome != null ) { apr.setBaseDir( aprHome ); } - - apr.loadNative(); + try { + apr.loadNative(); - apr.initialize(); + apr.initialize(); + } catch( Throwable t ) { + log.error("Native code not initialized, disabling UnixSocket and JNI channels: " + t.toString()); + return; + } if( log.isDebugEnabled() ) log.debug( "Creating pool " + gPool ); gPool=apr.poolCreate( 0 );
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>