java - 发送电子邮件时出现以下错误 - java 6 tomcat 6

标签 java tomcat

<分区>

javax.mail.MessagingException: Exception reading response; nested exception is:
javax.net.ssl.SSLHandshakeException: 
sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: 
  unable to find valid certification path to requested target

最佳答案

javax.mail.MessagingException 的发生可能有多种原因。由于您尚未发布任何代码,因此几乎不可能正确地说出造成这种情况的原因。

查看错误的第二部分“PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径”

现在我不能 100% 肯定地说,但这些错误很可能与证书有关。即很可能您的 Java 运行时不信任该证书。

通常 Java 通过标准的信任链机制来验证证书。但是,如果该链以 Java 不信任的证书终止,则 Java 将以上述方式进行投诉。

The solution if this is the case would be to 

1. Download the certificate from the remote SMTP server

2. Import the certificate into your local truststore

有关这些的详细信息,请访问以下链接

http://springinpractice.com/2012/04/29/fixing-pkix-path-building-issues-when-using-javamail-and-smtp

同时检查以下链接

Error in JavaMail : PKIX path building failed unable to find valid certification path to requested target

how to ignore server cert error in javamail

How to solve an error: unable to find valid certification path to requested target error in Java?

关于java - 发送电子邮件时出现以下错误 - java 6 tomcat 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30186147/

相关文章:

java - 如何在linux上升级Tomcat

eclipse - 在 Eclipse 中调试 Tomcat Web 应用程序

tomcat - 在单个服务器上运行 2 个 tomcat 实例

java - 如何检查动态数的倍数是否等于另一个动态数

java - 使用简单的 xml 持久化对象时如何格式化日期或 double 值

java - webview 上的 android 谷歌地图

java - Zebra 打印机 GC420t 无法打印图像 EPL 2 GW

tomcat - 错误页面(500.html、404.html 等)未在 rails/jruby 环境中呈现

java - rhc 端口转发 - 开类问题

apache - 为什么 Tomcat 缺少内置的速率限制过滤器?