logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r692676 - in /logging/log4j/trunk: NTEventLogAppender.amd64.dll src/assembly/bin.xml src/main/java/org/apache/log4j/nt/NTEventLogAppender.java src/ntdll/resources/
Date Sat, 06 Sep 2008 16:20:40 GMT
Author: carnold
Date: Sat Sep  6 09:20:38 2008
New Revision: 692676

URL: http://svn.apache.org/viewvc?rev=692676&view=rev
Log:
Bug 44386: Restoring exception out of static initializer when missing dll, relocating prebuilt
amd64

Added:
    logging/log4j/trunk/NTEventLogAppender.amd64.dll   (props changed)
      - copied unchanged from r692580, logging/log4j/trunk/src/ntdll/resources/NTEventLogAppender.amd64.dll
Removed:
    logging/log4j/trunk/src/ntdll/resources/
Modified:
    logging/log4j/trunk/src/assembly/bin.xml
    logging/log4j/trunk/src/main/java/org/apache/log4j/nt/NTEventLogAppender.java

Propchange: logging/log4j/trunk/NTEventLogAppender.amd64.dll
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: logging/log4j/trunk/NTEventLogAppender.amd64.dll
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: logging/log4j/trunk/src/assembly/bin.xml
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/assembly/bin.xml?rev=692676&r1=692675&r2=692676&view=diff
==============================================================================
--- logging/log4j/trunk/src/assembly/bin.xml (original)
+++ logging/log4j/trunk/src/assembly/bin.xml Sat Sep  6 09:20:38 2008
@@ -61,7 +61,7 @@
                    <fileMode>0755</fileMode>
                 </file>
                 <file>
-                   <source>src/ntdll/resources/NTEventLogAppender.amd64.dll</source>
+                   <source>NTEventLogAppender.amd64.dll</source>
                    <fileMode>0755</fileMode>
                 </file>
         </files>

Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/nt/NTEventLogAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/nt/NTEventLogAppender.java?rev=692676&r1=692675&r2=692676&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/nt/NTEventLogAppender.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/nt/NTEventLogAppender.java Sat Sep
 6 09:20:38 2008
@@ -161,29 +161,22 @@
   static {
     String[] archs;
     try {
-        archs = new String[] { "." + System.getProperty("os.arch"), ""};
+        archs = new String[] { System.getProperty("os.arch")};
     } catch(SecurityException e) {
-        archs = new String[] { ".amd64", ".ia64", ".x86", ""};
+        archs = new String[] { "amd64", "ia64", "x86"};
     }
-    Throwable t = null;
+    boolean loaded = false;
     for(int i = 0; i < archs.length; i++) {
         try {
-            System.loadLibrary("NTEventLogAppender" + archs[i]);
-            t = null;
+            System.loadLibrary("NTEventLogAppender." + archs[i]);
+            loaded = true;
             break;
         } catch(java.lang.UnsatisfiedLinkError e) {
-            t = e;
+            loaded = false;
         }
     }
-    if (t != null) {
-        StringBuffer buf = new StringBuffer("Unable to load");
-        for (int i = 0; i < archs.length - 1; i++) {
-            buf.append(" NTEventLogAppender");
-            buf.append(archs[i]);
-            buf.append(".dll");
-        }
-        buf.append(" or NTEventLogAppender.dll.");
-        LogLog.error(buf.toString(), t);
+    if (!loaded) {
+        System.loadLibrary("NTEventLogAppender");
     }
 }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message