Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326030 - Medic diagnostics for unsupported appender types is poor
Summary: Medic diagnostics for unsupported appender types is poor
Status: CLOSED FIXED
Alias: None
Product: Virgo
Classification: RT
Component: unknown (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Glyn Normington CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-23 06:35 EDT by Steve Powell CLA
Modified: 2010-09-27 11:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Powell CLA 2010-09-23 06:35:23 EDT
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.
Comment 1 Steve Powell CLA 2010-09-23 09:31:55 EDT
Came from investigation in Bug 322398
Comment 2 Glyn Normington CLA 2010-09-27 11:11:47 EDT
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.