Community
Participate
Working Groups
When using SMTPAppender in serviceability.xml, logback/medic throws an exception during startup which omits mention of the underlying error -- --8<----- org.eclipse.virgo.medic.log.impl.logback.LoggerContextConfigurationFailedException: Configuration failed with the following problems: [Could not create an Appender of type [ch.qos.logback.classic.net.SMTPAppender]., ActionException in Action for tag [appender]] at org.eclipse.virgo.medic.log.impl.logback.JoranLoggerContextConfigurer.reportFailureIfNecessary(JoranLoggerContextConfigurer.java:50) at org.eclipse.virgo.medic.log.impl.logback.JoranLoggerContextConfigurer.applyConfiguration(JoranLoggerContextConfigurer.java:42) --------- which is actually a NoClassDefFound error. The diagnostic code should be improved to put the cause (and the accompanying stacktrace) on the exception that is presently thrown so we can diagnose the problem.
Came from investigation in Bug 322398
If available, it now also prints the cause. For example: org.eclipse.virgo.medic.log.impl.logback.LoggerContextConfigurationFailedException: Configuration failed with the following problems: [Could not create an Appender of type [ch.qos.logback.classic.net.SMTPAppender]. Caused by java.lang.NoClassDefFoundError: javax/mail/Multipart., ActionException in Action for tag [appender] Caused by ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.classic.net.SMTPAppender.] at org.eclipse.virgo.medic.log.impl.logback.JoranLoggerContextConfigurer.reportFailureIfNecessary(JoranLoggerContextConfigurer.java:54) at <etc.> The crucial information buried inside the list of 2 errors is: java.lang.NoClassDefFoundError: javax/mail/Multipart which shows that javax.mail is the optional import in medic which needs satisfying.