Jasper Reports MailAuthenticationException Authentication failed-No authentication mechanisms supported by both server and client
search cancel

Jasper Reports MailAuthenticationException Authentication failed-No authentication mechanisms supported by both server and client

book

Article ID: 271361

calendar_today

Updated On:

Products

CA Identity Suite

Issue/Introduction

We have installed JasperReports 8.1 on Windows 2019. We are trying to schedule a report so that we can receive it by email. We are getting below error in jasperserver.log file.

2023-07-31T10:25:02,103 ERROR SecureExceptionHandlerImpl,JasperServerScheduler_Worker-1:125 - The job error notification was not completed. An error occurred while sending it.. No authentication mechanisms supported by both server and client org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: No authentication mechanisms supported by both server and client
 at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:440)
 at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:361)
 at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:356)
 at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJobMailNotificationImpl.sendMailNotification(ReportExecutionJobMailNotificationImpl.java:141)
 at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:884)
 at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:658)
 at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:309)
 at com.jaspersoft.ji.report.options.engine.ReportOptionsExecutionJob.execute(ReportOptionsExecutionJob.java:47)
 at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: javax.mail.AuthenticationFailedException: No authentication mechanisms supported by both server and client
 at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:880)
 at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:780)
 at javax.mail.Service.connect(Service.java:366)
 at org.springframework.mail.javamail.JavaMailSenderImpl.connectTransport(JavaMailSenderImpl.java:518)
 at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:437)

FYI. We have same configuration in JasperReport 7.1.1 and it works fine there.

 

Environment

Release : 14.4

Resolution

1. Ensure that the 'js.quartz.properties' is configured as below. 

 

report.scheduler.mail.sender.host=mailserver.com                                      /hostname of the mail server of mail relay server

report.scheduler.mail.sender.username=

report.scheduler.mail.sender.password=

report.scheduler.mail.sender.from=reportadmin@mailserver.com             /report server's sender email account

report.scheduler.mail.sender.protocol=smtp

report.scheduler.mail.sender.port=25

 

2, And applicationContext-report-scheduling’ file is supposed to have 'mail.smtp.auth' set as ‘false’

<prop key="mail.smtp.auth">false</prop>

 

After these settinga, we are able to get reports by email.