I have 2 servers with same configuration and same version of application on it. First of it was on CentOS 7, this operating system now is not supported, so on second server I installed Alma Linux 9.
Both servers have the same version of Java installed and have the same SMTP configuration
On the new server with Alma 9, there’s a problem with mails. If I try to send mail from system there’s a error in logs:
com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError
javax.faces.el.EvaluationException:
java.lang.IncompatibleClassChangeError: class
javax.mail.internet.MimeBodyPart$MimePartDataHandler cannot inherit
from final class javax.activation.DataHandler
on line:
MimeMessage mimeMessage = mailSender.createMimeMessage();
where mailSender is
private final JavaMailSenderImpl mailSender;
from spring-context-support-5.3.27.jar and MimeMessage is imported javax.mail.internet.MimeMessage;
I also use:
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>1.6.7</version>
</dependency>
I tried to change import of MimeMessage from javax to jakarta, but there’s another problem that mailSender.createMimeMessage(); returns javax type. I also add javax.activation dependency to pom.xml, but without any result
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
Is it possible that the Linux version cause this error? I don’t see any other difference in both servers. Or maybe there’s different problem somewhere, any advice?
3