ClassCastException gnu.mail.handler.TextPlain when Sending Test Mail due to GNU Java

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

Symptoms

An error has occurred Configuring a Server for Outgoing Mail:

1 2 3 java.lang.ClassCastException: gnu.mail.handler.TextPlain at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:496)

Cause

The gnu version of JavaMail and the Sun version of JavaMail are both in the class path.

Resolution

Install the javamail package and remove the gnumailpackage.

Updated on April 1, 2025

Still need help?

The Atlassian Community is here for you.