DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34718>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34718

           Summary: ugli.LoggerFactory may NullPointerException
           Product: Log4j
           Version: 1.3alpha
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: [EMAIL PROTECTED]


LoggerFactory static initialisation contains the statements

ClassLoader cl = (org.apache.ugli.LoggerFactoryAdapter.class).getClassLoader();
InputStream is = cl.getResourceAsStream("ugli.properties");

But the javadoc for getClassLoader() states:
 " Some implementations may use null to represent the bootstrap class loader.
 This method will return null in such implementations if this class was loaded
 by the bootstrap class loader."

[This happened to me when debugging in Eclipse, causing the second statement to 
fail with a NullPointerException] 

I'm not an expert in the devious art of ClassLoaders but I suspect that 
inserting the following statement is a legitimate fix:

    if (cl==null) cl=ClassLoader.getSystemClassLoader();

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to