Email Delivery is not working in Jasper Server

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

We had to restart our AWS instance in mid November 2015 and ipaddress changed after the restart. After that email delivery of scheduled report is not working. I read in online community and tried mutiple options. Still it is not working 
 
Here is the snapshot of error in Jasper server log
 
ERROR ReportExecutionJob,quartzScheduler_Worker-2:311 - The job error notification was not completed. An error occurred while sending it.
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Exception reading response;
  nested exception is:
        javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?. Failed messages: javax.mail.MessagingException: Exception reading response;
  nested exception is:
        javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: Exception reading response;
  nested exception is:
        javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
        at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462)
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
        at javax.mail.Service.connect(Service.java:275)
        at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336)
        at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJobMailNotificationImpl.sendMailNotification(ReportExecutionJobMailNotificationImpl.java:135)
        at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.sendMailNotification(ReportExecutionJob.java:976)
        at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:572)
        at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:222)
        at com.jaspersoft.ji.report.options.engine.ReportOptionsExecutionJob.execute(ReportOptionsExecutionJob.java:49)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
        at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:671)
        at sun.security.ssl.InputRecord.read(InputRecord.java:504)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)
        at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:901)
        at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
        at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)
        at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440)
        ... 13 more
 
here are the details in js.quartz.properties file
 
report.scheduler.web.deployment.uri=http://jasper.flint.com/jasperserver-pro
 
report.scheduler.mail.sender.host=smtp.gmail.com
report.scheduler.mail.sender.username=user@flint.com
report.scheduler.mail.sender.password=********
report.scheduler.mail.sender.from=user@flint.com
report.scheduler.mail.sender.protocol=smtps
#report.scheduler.mail.sender.port=465
report.scheduler.mail.sender.port=587
report.scheduler.mail.smtps.starttls.auth=true
 
I need some help to resolve this issue.
 
Thanks,
Gowri
gowri's picture
53
Joined: Jun 24 2014 - 5:04pm
Last seen: 6 years 5 months ago

Hi,

Thanks for the message. I tried below mentioned options and still I am getting error

- The job error notification was not completed. An error occurred while sending it.

org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Exception reading response;
  nested exception is:
        javax.net.ssl.SSLException: Server key. Failed messages: javax.mail.MessagingException: Exception reading response;
  nested exception is:
        javax.net.ssl.SSLException: Server key; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: Exception reading response;
  nested exception is:
        javax.net.ssl.SSLException: Server key
 

Thanks,

Gowri

gowri - 6 years 5 months ago

2 Answers:

It looks liek a secutiry certificate issue in the SSL connection to the Google Mail SMTP (which uses smtps protocol). Make sure your configuration is correct.

i.e. check that /jasperserver-pro/WEB-INF/applicationContext-report-scheduling.xml looks something like this:

<property name="javaMailProperties">
    <props>
        <prop key="mail.smtps.auth">true</prop>
        <prop key="mail.smtps.starttls.enable">true</prop>
    </props>
</property>
- here is more info http://stackoverflow.com/questions/9683679/email-not-sent-in-jasper-report-scheduling with different settings for other providers (like MS Exchange)
marianol's picture
12148
Joined: Sep 13 2011 - 8:04am
Last seen: 3 years 9 months ago

OK, now the error has changed. " Mail server connection failed;" So it looks like there may be an issue with the Gmail connection, do anything else shows in the logs?
Have you enabled 2 factor auth? https://galleryserverpro.com/use-gmail-as-your-smtp-server-even-when-usi...
Have you turned on Google’s ‘less secure apps’ setting?
Can you access that Gmail account from another SMTP server? You can probably test using the console. something like:

openssl s_client -connect smtp.gmail.com:587

or

openssl s_client -connect smtp.gmail.com:465  -starttls smtp 

You can see this thread as an example: http://stackoverflow.com/questions/1516754/connecting-to-smtp-gmail-com-...
remember that for Gmail port 587 forces the connection to use TLS and port 465 is for implicit SSL

Since you are using Google Apps you may save yourself a lot of headaches by using "smtp-relay.gmail.com" wich allows you to setup standard connections on port 25 by whilelisting your app IP address, Check this: https://support.google.com/a/answer/176600?hl=en

marianol's picture
12148
Joined: Sep 13 2011 - 8:04am
Last seen: 3 years 9 months ago
Feedback