我们最近将代码从 Java 5 迁移到 Java 7,将 Tomcat 6 迁移到 Tomcat 7,将 Spring 2.5 迁移到 Spring 4.0.6。所有这些都在一起。Unix 服务器在内存和磁盘空间方面也进行了升级。但是自从发布以来,当批处理作业发送电子邮件时,我们在生产中遇到了错误。我们不确定是什么导致了这个错误。我看到一些其他的帖子,比如
是否有解决方法:java.lang.RuntimeException:无法生成 DH 密钥对
但他们不是没有帮助。有人可以用简单的语言解释导致此问题的原因。
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Exception reading response;
nested exception is:
javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair. Failed messages: javax.mail.MessagingException: Exception reading r
esponse;
nested exception is:
javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: Exception reading response;
nested exception is:
javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
at javax.mail.Service.connect(Service.java:288)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:397)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:346)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:363)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:351)
at xxx.AbstractEmailServices.sendSingleEmail(AbstractEmailServices.java:281)
at xxx.EmailServices.sendEmail(EmailServices.java:87)
at xxx.EmailHelper.sendEmail(EmailHelper.java:60)
at xxx.EmailHelper.sendEmail(EmailHelper.java:47)
at xxx.CSVJobListener.afterJob(CSVJobListener.java:68)
at org.springframework.batch.core.listener.CompositeJobExecutionListener.afterJob(CompositeJobExecutionListener.java:60)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:343)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:134)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)