[slf4j-dev] [Bug 146] New: NullPointerException when getILoggerFactory()
bugzilla-daemon at pixie.qos.ch
bugzilla-daemon at pixie.qos.ch
Tue Sep 1 08:51:45 CEST 2009
http://bugzilla.slf4j.org/show_bug.cgi?id=146
Summary: NullPointerException when getILoggerFactory()
Product: SLF4J
Version: 1.5.x
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: blocker
Priority: P1
Component: Core API
AssignedTo: dev at slf4j.org
ReportedBy: dapeng.ni at edgenius.com
I got this exception when I run my class in Eclipse:
log = LoggerFactory.getLogger(SilenceInstall.class);
Exception in thread "main" java.lang.NullPointerException
at
org.slf4j.LoggerFactory.singleImplementationSanityCheck(LoggerFactory.java:192)
at
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:113)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
at
com.foo.installation.SilenceInstall.main(SilenceInstall.java:99)
It is due to LoggerFactory.class.getClassLoader() returns null in:
private static void singleImplementationSanityCheck() {
try {
Enumeration paths = LoggerFactory.class.getClassLoader().getResources(
STATIC_LOGGER_BINDER_PATH);
....
According to JavaDoc, getClassLoader() can be null: "Some implementations may
use null to represent the bootstrap class loader. "
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the slf4j-dev
mailing list