Hi, we are hit by a NPE while configuring Logback. Here is the stacktrace:
java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at
ch.qos.logback.core.joran.spi.ConfigurationWatchList.convertToFile(ConfigurationWatchList.java:88)
at
ch.qos.logback.core.joran.spi.ConfigurationWatchList.addAsFileToWatch(ConfigurationWatchList.java:52)
at
ch.qos.logback.core.joran.spi.ConfigurationWatchList.setMainURL(ConfigurationWatchList.java:48)
at
ch.qos.logback.core.joran.util.ConfigurationWatchListUtil.setMainWatchURL(ConfigurationWatchListUtil.java:46)
at
ch.qos.logback.core.joran.GenericConfigurator.informContextOfURLUsedForConfiguration(GenericConfigurator.java:92)
at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:48)
at
com.axege.core.init.AxabasContextListener.contextInitialized(AxabasContextListener.java:48)
The code in AxabasContextListener looks like this:
URL confFile = this.getClass().getResource(logContextFilePath);
if (confFile != null) {
LoggerContext lc = (LoggerContext)
LoggerFactory.getILoggerFactory();
StatusManager statusManager = lc.getStatusManager();
OnConsoleStatusListener onConsoleListener = new
OnConsoleStatusListener();
statusManager.add(onConsoleListener);
try {
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(lc);
// the context was probably already configured by
default configuration rules
lc.reset();
configurator.doConfigure(confFile);
} catch (JoranException je) {
je.printStackTrace();
}
StatusPrinter.printInCaseOfErrorsOrWarnings(lc);
}
So we check if confFile exists, and it does, but we get a NPE in Joran...
The very same code works on different environments, so this is probably
due to the specific context we are deploying in, but we can't figure it
out...
Any help or pointer would be greatly appreciated. Regards, Franck
smime.p7s
Description: Signature cryptographique S/MIME
_______________________________________________ Logback-user mailing list [email protected] http://mailman.qos.ch/mailman/listinfo/logback-user
