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@slf4j.org ReportedBy: dapeng...@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. _______________________________________________ dev mailing list dev@slf4j.org http://www.slf4j.org/mailman/listinfo/dev