[logback-user] Logback NPE in Felix OSGi container.
Ceki Gülcü
ceki at qos.ch
Wed Oct 13 22:15:36 CEST 2010
In the getResourceOccurenceCount method of the
ch.qos.logback.core.util.Loader class, it is assumed that the
getResource method of the class loader instance will return a non-null
enumeration. This assumption does apparently not hold in Felix.
Please enter a bug report so that we can fix the issue.
On 13/10/2010 9:18 PM, Mark Protas wrote:
> I'm hitting an NPE in logger initialization in the Felix OSGi container
> if I specify the logback.configurationFile system property. Without the
> system property, I don't hit this and everything logs to the
> ConsoleAppender as expected. Any suggestions as to how to fix this?
>
> java.lang.NullPointerException
> at ch.qos.logback.core.util.Loader.getResourceOccurenceCount(Loader.java:58)
> at
> ch.qos.logback.classic.util.ContextInitializer.multiplicityWarning(ContextInitializer.java:160)
> at
> ch.qos.logback.classic.util.ContextInitializer.statusOnResourceSearch(ContextInitializer.java:183)
> at
> ch.qos.logback.classic.util.ContextInitializer.findConfigFileURLFromSystemProperties(ContextInitializer.java:111)
> at
> ch.qos.logback.classic.util.ContextInitializer.findURLOfDefaultConfigurationFile(ContextInitializer.java:120)
> at
> ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
> at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
> at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
> at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
> at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
> at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
> at com.weiglewilczek.slf4s.Logger$.apply(logger.scala:32)
> at com.weiglewilczek.scalamodules.package$.<init>(package.scala:84)
> at com.weiglewilczek.scalamodules.package$.<clinit>(package.scala)
> at com.smiley.validation.create.Activator.start(Activator.scala:22)
> at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:633)
> at org.apache.felix.framework.Felix.activateBundle(Felix.java:1822)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:1739)
> at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1143)
> at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
> at java.lang.Thread.run(Thread.java:637)
>
> http://qos.ch/mailman/listinfo/logback-user
More information about the Logback-user
mailing list