gowri Posted January 20, 2016 Share Posted January 20, 2016 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 More sharing options...
Solution marianol Posted January 20, 2016 Solution Share Posted January 20, 2016 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]See this http://community.jaspersoft.com/wiki/how-configure-jasperreports-server-send-e-mails-gmail-mail-account and this answer http://community.jaspersoft.com/questions/540414/config-jsquartzproperties-use-gmail- and this blog post http://www.ricardomalla.com/?p=528- 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 More sharing options...
gowri Posted January 29, 2016 Author Share Posted January 29, 2016 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 More sharing options...
marianol Posted February 1, 2016 Share Posted February 1, 2016 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:587oropenssl 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-lineremember that for Gmail port 587 forces the connection to use TLS and port 465 is for implicit SSLSince 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now