Author: carnold
Date: Thu Aug 23 09:02:45 2007
New Revision: 569053

URL: http://svn.apache.org/viewvc?rev=569053&view=rev
Log:
Bug 43200: Log4JEntityResolver will return null if log4j.dtd can not be found 
on classpath

Modified:
    logging/log4j/trunk/src/changes/changes.xml
    
logging/log4j/trunk/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java

Modified: logging/log4j/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/logging/log4j/trunk/src/changes/changes.xml?rev=569053&r1=569052&r2=569053&view=diff
==============================================================================
--- logging/log4j/trunk/src/changes/changes.xml (original)
+++ logging/log4j/trunk/src/changes/changes.xml Thu Aug 23 09:02:45 2007
@@ -22,6 +22,7 @@
   <body>
   
     <release version="1.2.15" date="2007-06-27" description="SyslogAppender 
enhancements, NTEventLogAppender and Maven build.">
+        <action action="fix" issue="43200">Log4JEntityResolver will return 
null if log4j.dtd can not be found on classpath.</action>
         <action action="fix" 
issue="37736">HierarchyEventListener.removeAppenderEvent never called.</action>
         <action action="fix" issue="37560">XMLLayout does not escape CDATA 
sections within NDC or throwables.</action>
        <action action="add" issue="33502">Added test to confirm that 
DOMConfigurator.configureAndWatch does configure.</action>

Modified: 
logging/log4j/trunk/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java
URL: 
http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java?rev=569053&r1=569052&r2=569053&view=diff
==============================================================================
--- 
logging/log4j/trunk/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java 
(original)
+++ 
logging/log4j/trunk/src/main/java/org/apache/log4j/xml/Log4jEntityResolver.java 
Thu Aug 23 09:02:45 2007
@@ -22,6 +22,7 @@
 import org.xml.sax.InputSource;
 
 import java.io.InputStream;
+import java.io.ByteArrayInputStream;
 
 /**
  * An [EMAIL PROTECTED] EntityResolver} specifically designed to return
@@ -37,12 +38,11 @@
       Class clazz = getClass();
       InputStream in = 
clazz.getResourceAsStream("/org/apache/log4j/xml/log4j.dtd");
       if (in == null) {
-       LogLog.error("Could not find [log4j.dtd]. Used [" + 
clazz.getClassLoader() 
+           LogLog.error("Could not find [log4j.dtd]. Used [" + 
clazz.getClassLoader()
                     + "] class loader in the search.");
-       return null;
-      } else {
-       return new InputSource(in);
+        in = new ByteArrayInputStream(new byte[0]);
       }
+         return new InputSource(in);
     } else {
       return null;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to