当前位置: 首页 > 知识库问答 >
问题:

无法通过jenkins发送邮件,出现异常

金健
2023-03-14

我正试图在詹金斯设置电子邮件通知

但当我点击测试配置时,我得到了下面的错误

请参考附件截图以及下面的错误

请帮帮我,我被困在这里了。

太阳安全供应商。certpath。SunCertPathBuilderException:找不到请求目标的有效证书路径

at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)

at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)

at java.security.cert.CertPathBuilder.build(Unknown Source)

原因:sun.security.validator.验证器异常:PKIX路径构建失败

at sun.security.validator.PKIXValidator.doBuild(Unknown Source)

at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)

at sun.security.validator.Validator.validate(Unknown Source)

at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)

at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)

at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)

原因:javax。网ssl。SSLHandshakeException

at sun.security.ssl.Alerts.getSSLException(Unknown Source)

at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)

at sun.security.ssl.Handshaker.fatalSE(Unknown Source)

at sun.security.ssl.Handshaker.fatalSE(Unknown Source)

at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)

at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)

at sun.security.ssl.Handshaker.processLoop(Unknown Source)

at sun.security.ssl.Handshaker.process_record(Unknown Source)

at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)

at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)

at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)

at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)

at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)

at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)

原因:javax。邮政MessaginException:无法连接到SMTP主机:SMTP。gmail。com,端口:465;嵌套的例外是:javax。网ssl。例外:太阳。安全验证器。ValidatorException:PKIX路径生成失败:sun。安全供应商。certpath。SunCertPathBuilderException:找不到请求目标的有效证书路径

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)

at javax.mail.Service.connect(Service.java:317)

at javax.mail.Service.connect(Service.java:176)

at javax.mail.Service.connect(Service.java:125)

at javax.mail.Transport.send0(Transport.java:194)

at javax.mail.Transport.send(Transport.java:124)

at hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:581)

at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)

at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)

at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)

at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)

at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)

at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)

at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)

at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)

at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)

at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)

at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)

at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)

at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)

at org.kohsuke.stapler.Stapler.service(Stapler.java:238)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)

at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)

at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:138)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)

at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)

at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)

at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)

at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)

at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)

at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.server.Server.handle(Server.java:564)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)

at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)

at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)

at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)

at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

共有1个答案

越福
2023-03-14

你有没有配置你的gmail访问低安全性的应用程序。如果您没有完成,请检查此选项。更新插件,如果你有任何新的更新插件。如果你看到错误,你将面临认证问题。

遵循认证发布的步骤:

您需要为smtp导入证书。gmail。通用域名格式

1)输入命令查看此证书

C:\openssl\bin\openssl.exe s_client -connect smtp.gmail.com:465

2) 复制副本并保存“----开始证书------”之间的行

“----END CERTIFICATE---”放入文件,例如:-gmail。cer

3)使用此命令导出keyool-导入-aliassmtp.gmail.com-keystore"%JAVA_HOME%/jre/lib/Security/cacerts"-file C:\用户\ca\Desktop\gmail\gmail.cer

4)输入密码chageit

5) 单击“是”导入证书

6) 重启java

希望对你有用

 类似资料:
  • 我目前有一个邮件服务器正在运行。我可以通过 mywebsite.com/roundcube/ 从这个网站我可以发送和接收电子邮件适当。日志显示所有的邮件进出都很好。我从这里发到我的gmail账户,然后又发回来。 然而,我真正想做的是使用javax mail从java发送一些邮件。

  • 我阅读了javamail-android的指南和一些关于StackOverflow的帖子。例如。如何在Android中使用JavaMail API发送邮件?我收到消息“邮件发送成功...”。但邮件不会到达收件人地址。我有以下输出: 我如何修复它或使用另一种方式发送电子邮件?

  • 我使用SendInBlue Java Api发送电子邮件,我在scala中编写了以下代码: 但我得到了这个错误:{“代码”:“失败”,“消息”:“需要有效的”至“电子邮件地址”,“数据”:[]}

  • 我有一个代码,就像半年前一样工作。它基本上发送电子邮件。 这是例外 (534, b'5.7.14 5.7.14 KL7\u 2qGSLW9IBjP8dKKgP67bEgyKNc5ls76dnVDZcUlVQjJUQb0JX9BIVi\u Agb84vKNOKB 5.7.14fshB0ngZ_Tn8ocDpDHKavRKXmluVjHo5YM7ADKENtWn4aVTxyvaBlbXRGpA1EBh

  • 问题内容: 我必须配置SMTP服务器,以便在Jenkins的配置路径中可以提供SMTP服务器。有人可以说出如何在Ubuntu中配置SMTP服务器以及如何在Jenkins Email-Ext插件中映射该服务器。 问题答案: 我发现解决方案为:- 1)sudo apt-get install mailutils(在Jenkins机器上) 2)在Jenkins中安装Email-ext插件。 3)登录Je

  • 通过Java发送邮件时获取异常 例外情况是: 以下是Java代码: 我在运输方面出了差错。发送(msg);我在这里使用的JAR::smtp 1.6.0、Javax Mail 1.4.7、邮件激活