Jump to content
Changes to the Jaspersoft community edition download ×

Email Delivery is not working in Jasper Server


gowri
Go to solution Solved by marianol,

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

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>[/code]
- 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)
And also this may help: 
 
 
Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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-using-2-factor-authentication-2-step-verification/
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-via-command-line
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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...