在Java邮件中,发送正在跟踪异常
javax.mail.MessagingException: Can't send command to SMTP host;
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
at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1365)
at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1353)
at com.sun.mail.smtp.SMTPTransport.ehlo(SMTPTransport.java:794)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:336)
at javax.mail.Service.connect(Service.java:258)
at javax.mail.Service.connect(Service.java:137)
at javax.mail.Service.connect(Service.java:86)
at javax.mail.Transport.send0(Transport.java:150)
at javax.mail.Transport.send(Transport.java:80)
at com.csdcsystems.amanda.common.utility.EmailHelper.sendMail(EmailHelper.java:244)
at com.csdcsystems.amanda.jems.web.viewmodel.FolderEmailPrintOutputViewModel.sendEmail(FolderEmailPrintOutputViewModel.java:117)
at com.csdcsystems.amanda.jems.web.viewmodel.FolderEmailPrintOutputViewModel.sendEmail(FolderEmailPrintOutputViewModel.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:109)
at org.zkoss.bind.impl.BinderImpl.doExecute(BinderImpl.java:1508)
at org.zkoss.bind.impl.BinderImpl.doCommand(BinderImpl.java:1261)
at org.zkoss.bind.impl.BinderImpl.access$1500(BinderImpl.java:95)
at org.zkoss.bind.impl.BinderImpl$CommandEventListener.onEvent0(BinderImpl.java:1145)
at org.zkoss.bind.impl.BinderImpl$CommandEventListener.onEvent(BinderImpl.java:1103)
at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2734)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2705)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2646)
at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1709)
at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1494)
at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1204)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:558)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:456)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:464)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
答案 0 :(得分:2)
看看这里:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX路径构建失败: sun.security.provider.certpath.SunCertPathBuilderException:无法 找到所请求目标的有效证书路径
参见以下相关主题:
Solutions for SunCertPathBuilderException
How to solve sun.security.provider.certpath.SunCertPathBuilderException?
Allowing Java to use an untrusted certificate for SSL/HTTPS connection
Unable to find valid certification path to requested target - error even after cert imported