After Confluence Upgrade, JNDI Configured Email Gives Error Page When Sending Test Email
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
After an upgrade, mail configured via JNDI is failing when sending test email with an error page like
The following appears in the atlassian-confluence
.log
file
2016-01-04 12:10:08,350 ERROR [http-nio-8090-exec-2] [[Standalone].[localhost].[/].[action]] log Servlet.service() for servlet [action] in context with path [] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: javax.mail.Authenticator
or for scheduled jobs
2015-12-28 09:05:00,110 ERROR [scheduler_Worker-1] [org.quartz.core.JobRunShell] run Job DEFAULT.MailQueueFlushJob threw an unhandled Exception:
java.lang.NoClassDefFoundError: javax/mail/Authenticator
Diagnosis
Environment
- Confluence was recently upgraded
- Mail is configured through JNDI and
server.xml
contains the correct<Resource/>
entry.
Cause
The file mail-x.x.x.jar
has not been moved from <confluence-install>/confluence/WEB-INF/lib
to <confluence-install>/lib
.
Resolution
- Stop Confluence.
- Move (don't copy)
mail-x.x.x.jar
from<confluence-install>/confluence/WEB-INF/lib
to<confluence-install>/lib
.
Note: where x.x.x. represents the version numbers on the jar files in your installation.
Do not leave a renamed backup of the jar files in/confluence/WEB-INF/lib
. Even with a different file name, the files will still be loaded as long as it remains in the directory. - Restart Confluence.
For more information, please see the Confluence documentation on Setting Up a Mail Session for the Confluence Distribution.