After Confluence Upgrade, JNDI Configured Email Gives Error Page When Sending Test Email
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Summary
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
1
2
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
1
2
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
.
Solution
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.
Was this helpful?