I have tried to use the logback SMTPAppender in a Cuba 7.2.7 project but are running into a problem - Apparently because javax.mail is not present in app.jar
12:13:27,231 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender]
12:13:27,235 |-ERROR in ch.qos.logback.core.joran.action.AppenderAction - Could not create an Appender of type [ch.qos.logback.classic.net.SMTPAppender]. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to i
nstantiate type ch.qos.logback.classic.net.SMTPAppender
at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type ch.qos.logback.classic.net.SMTPAppender
at at
..
..
..
..
..
ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
at at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:45)
at at com.haulmont.uberjar.CubaJettyServer.createServer(CubaJettyServer.java:143)
at at com.haulmont.uberjar.CubaJettyServer.start(CubaJettyServer.java:126)
at at com.haulmont.uberjar.ServerRunner.execute(ServerRunner.java:249)
at at com.haulmont.uberjar.ServerRunner.main(ServerRunner.java:39)
Caused by: java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
Yes, your project is OK and works like a charm for me.
I created an uberJar and started it using java -jar app.jar.
Console log
13:28:05,801 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender]
13:28:05,811 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [emailAppender]
13:28:05,827 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
13:28:05,828 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [Console]
13:28:05,830 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:28:05,831 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [Console] to Logger[ROOT]
13:28:05,832 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [File] to Logger[ROOT]
13:28:05,832 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [emailAppender] to Logger[ROOT]
Please, open the packed uberJar and make sure that you have folder javax/mail in the root of the jar file like on the picture below: