You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2009/10/15 20:52:33 UTC

svn commit: r825617 - /incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java

Author: burn
Date: Thu Oct 15 18:52:33 2009
New Revision: 825617

URL: http://svn.apache.org/viewvc?rev=825617&view=rev
Log:
UIMA-1621 Use current class loader if properties file but found with system loader 

Modified:
    incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java

Modified: incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java?rev=825617&r1=825616&r2=825617&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java Thu Oct 15 18:52:33 2009
@@ -36,6 +36,7 @@
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
@@ -1297,7 +1298,16 @@
     // initialize log framework
     LogManager logManager = LogManager.getLogManager();
     try {
-      logManager.readConfiguration(ClassLoader.getSystemResourceAsStream(loggerPropertiesFileName));
+      InputStream ins = ClassLoader.getSystemResourceAsStream(loggerPropertiesFileName);
+      // Try the current class loader if system one cannot find the file
+      if (ins == null) {
+    	ins = this.getClass().getClassLoader().getResourceAsStream(loggerPropertiesFileName);
+      }
+      if (ins != null) {
+    	logManager.readConfiguration(ins);
+      } else {
+    	System.out.println("WARNING: failed to load "+loggerPropertiesFileName);
+      }
     } catch (SecurityException e) {
       handleException(e);
       return;