2013-02-21 52 views
3

我想從本地主機發送電子郵件。我正在使用websphere應用程序服務器。我得到以下錯誤:無法從本地主機發送郵件(websphere應用服務器)

[2/21/13 9:21:24:407 IST] 00000036 SystemOut  O DEBUG: setDebug: JavaMail version 1.4ea 
[2/21/13 9:21:24:502 IST] 00000036 SystemOut  O DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] 
[2/21/13 9:21:24:527 IST] 00000036 SystemOut  O DEBUG SMTP: useEhlo true, useAuth true 
[2/21/13 9:21:24:527 IST] 00000036 SystemOut  O DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL false 
[2/21/13 9:21:25:212 IST] 00000036 WSX509TrustMa E CWPKI0022E: SSL HANDSHAKE FAILURE: A signer with SubjectDN "CN=smtp.gmail.com, O=Google Inc, L=Mountain View, ST=California, C=US" was sent from target host:port "*:9043". The signer may need to be added to local trust store "C:/Program Files (x86)/IBM/SDP/runtimes/base_v7/profiles/was70profile1/config/cells/drunkendeath-PCNode01Cell/nodes/drunkendeath-PCNode01/trust.p12" located in SSL configuration alias "NodeDefaultSSLSettings" loaded from SSL configuration file "security.xml". The extended error message from the SSL handshake exception is: "PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is: 
    java.security.cert.CertPathValidatorException: The certificate issued by OU=Equifax Secure Certificate Authority, O=Equifax, C=US is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error". 
[2/21/13 9:21:25:214 IST] 00000036 SystemOut  O DEBUG SMTP: exception reading response: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.g: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is: 
    java.security.cert.CertPathValidatorException: The certificate issued by OU=Equifax Secure Certificate Authority, O=Equifax, C=US is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error 
[2/21/13 9:21:25:504 IST] 00000036 servlet  I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [IBMBookSalesProjectEAR] [/IBMBookSalesProject] [/order_success.jsp]: Initialization successful. 
[2/21/13 9:21:25:215 IST] 00000036 SystemErr  R javax.mail.MessagingException: Exception reading response; 
    nested exception is: 
    javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.g: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is: 
    java.security.cert.CertPathValidatorException: The certificate issued by OU=Equifax Secure Certificate Authority, O=Equifax, C=US is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error 
[2/21/13 9:21:25:216 IST] 00000036 SystemErr  R at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462) 
[2/21/13 9:21:25:216 IST] 00000036 SystemErr  R at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260) 
[2/21/13 9:21:25:216 IST] 00000036 SystemErr  R at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370) 
[2/21/13 9:21:25:216 IST] 00000036 SystemErr  R at javax.mail.Service.connect(Service.java:275) 
[2/21/13 9:21:25:216 IST] 00000036 SystemErr  R at javax.mail.Service.connect(Service.java:156) 
[2/21/13 9:21:25:216 IST] 00000036 SystemErr  R at com.tgmc.mail.MailSupport.sendMail(MailSupport.java:82) 
[2/21/13 9:21:25:216 IST] 00000036 SystemErr  R at com.tgmc.mail.MailSupport.sendMail(MailSupport.java:43) 
[2/21/13 9:21:25:217 IST] 00000036 SystemErr  R at com.tgmc.servlets.CompleteTransactionServlet.doPost(CompleteTransactionServlet.java:143) 
[2/21/13 9:21:25:217 IST] 00000036 SystemErr  R at com.tgmc.servlets.CompleteTransactionServlet.doGet(CompleteTransactionServlet.java:44) 
[2/21/13 9:21:25:217 IST] 00000036 SystemErr  R at javax.servlet.http.HttpServlet.service(HttpServlet.java:718) 
[2/21/13 9:21:25:217 IST] 00000036 SystemErr  R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) 
[2/21/13 9:21:25:217 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1449) 
[2/21/13 9:21:25:217 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790) 
[2/21/13 9:21:25:217 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443) 
[2/21/13 9:21:25:218 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175) 
[2/21/13 9:21:25:218 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610) 
[2/21/13 9:21:25:218 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274) 
[2/21/13 9:21:25:218 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926) 
[2/21/13 9:21:25:218 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557) 
[2/21/13 9:21:25:218 IST] 00000036 SystemErr  R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173) 
[2/21/13 9:21:25:219 IST] 00000036 SystemErr  R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455) 
[2/21/13 9:21:25:219 IST] 00000036 SystemErr  R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384) 
[2/21/13 9:21:25:219 IST] 00000036 SystemErr  R at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83) 
[2/21/13 9:21:25:219 IST] 00000036 SystemErr  R at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1772) 
[2/21/13 9:21:25:219 IST] 00000036 SystemErr  R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 
[2/21/13 9:21:25:219 IST] 00000036 SystemErr  R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 
[2/21/13 9:21:25:219 IST] 00000036 SystemErr  R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 
[2/21/13 9:21:25:220 IST] 00000036 SystemErr  R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) 
[2/21/13 9:21:25:220 IST] 00000036 SystemErr  R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202) 
[2/21/13 9:21:25:220 IST] 00000036 SystemErr  R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766) 
[2/21/13 9:21:25:220 IST] 00000036 SystemErr  R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896) 
[2/21/13 9:21:25:220 IST] 00000036 SystemErr  R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527) 
[2/21/13 9:21:25:220 IST] 00000036 SystemErr  R Caused by: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.g: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is: 
    java.security.cert.CertPathValidatorException: The certificate issued by OU=Equifax Secure Certificate Authority, O=Equifax, C=US is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error 
[2/21/13 9:21:25:221 IST] 00000036 SystemErr  R at com.ibm.jsse2.n.a(n.java:42) 
[2/21/13 9:21:25:221 IST] 00000036 SystemErr  R at com.ibm.jsse2.sc.a(sc.java:277) 
[2/21/13 9:21:25:221 IST] 00000036 SystemErr  R at com.ibm.jsse2.gb.a(gb.java:354) 
[2/21/13 9:21:25:221 IST] 00000036 SystemErr  R at com.ibm.jsse2.gb.a(gb.java:292) 
[2/21/13 9:21:25:221 IST] 00000036 SystemErr  R at com.ibm.jsse2.hb.a(hb.java:118) 
[2/21/13 9:21:25:222 IST] 00000036 SystemErr  R at com.ibm.jsse2.hb.a(hb.java:162) 
[2/21/13 9:21:25:222 IST] 00000036 SystemErr  R at com.ibm.jsse2.gb.n(gb.java:262) 
[2/21/13 9:21:25:222 IST] 00000036 SystemErr  R at com.ibm.jsse2.gb.a(gb.java:177) 
[2/21/13 9:21:25:222 IST] 00000036 SystemErr  R at com.ibm.jsse2.sc.a(sc.java:71) 
[2/21/13 9:21:25:222 IST] 00000036 SystemErr  R at com.ibm.jsse2.sc.g(sc.java:167) 
[2/21/13 9:21:25:222 IST] 00000036 SystemErr  R at com.ibm.jsse2.sc.a(sc.java:170) 
[2/21/13 9:21:25:222 IST] 00000036 SystemErr  R at com.ibm.jsse2.e.read(e.java:38) 
[2/21/13 9:21:25:223 IST] 00000036 SystemErr  R at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97) 
[2/21/13 9:21:25:223 IST] 00000036 SystemErr  R at java.io.BufferedInputStream.fill(BufferedInputStream.java:229) 
[2/21/13 9:21:25:223 IST] 00000036 SystemErr  R at java.io.BufferedInputStream.read(BufferedInputStream.java:248) 
[2/21/13 9:21:25:223 IST] 00000036 SystemErr  R at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75) 
[2/21/13 9:21:25:223 IST] 00000036 SystemErr  R at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440) 
[2/21/13 9:21:25:223 IST] 00000036 SystemErr  R ... 31 more 
[2/21/13 9:21:25:223 IST] 00000036 SystemErr  R Caused by: com.ibm.jsse2.util.g: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is: 
    java.security.cert.CertPathValidatorException: The certificate issued by OU=Equifax Secure Certificate Authority, O=Equifax, C=US is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error 
[2/21/13 9:21:25:224 IST] 00000036 SystemErr  R at com.ibm.jsse2.util.e.b(e.java:78) 
[2/21/13 9:21:25:224 IST] 00000036 SystemErr  R at com.ibm.jsse2.util.e.b(e.java:45) 
[2/21/13 9:21:25:224 IST] 00000036 SystemErr  R at com.ibm.jsse2.util.d.a(d.java:12) 
[2/21/13 9:21:25:225 IST] 00000036 SystemErr  R at com.ibm.jsse2.gc.a(gc.java:15) 
[2/21/13 9:21:25:225 IST] 00000036 SystemErr  R at com.ibm.jsse2.gc.checkServerTrusted(gc.java:48) 
[2/21/13 9:21:25:225 IST] 00000036 SystemErr  R at com.ibm.ws.ssl.core.WSX509TrustManager.checkServerTrusted(WSX509TrustManager.java:310) 
[2/21/13 9:21:25:225 IST] 00000036 SystemErr  R at com.ibm.jsse2.hb.a(hb.java:116) 
[2/21/13 9:21:25:225 IST] 00000036 SystemErr  R ... 43 more 
[2/21/13 9:21:25:225 IST] 00000036 SystemErr  R Caused by: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is: 
    java.security.cert.CertPathValidatorException: The certificate issued by OU=Equifax Secure Certificate Authority, O=Equifax, C=US is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error 
[2/21/13 9:21:25:226 IST] 00000036 SystemErr  R at com.ibm.security.cert.PKIXCertPathBuilderImpl.engineBuild(PKIXCertPathBuilderImpl.java:411) 
[2/21/13 9:21:25:226 IST] 00000036 SystemErr  R at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:258) 
[2/21/13 9:21:25:226 IST] 00000036 SystemErr  R at com.ibm.jsse2.util.e.b(e.java:51) 
[2/21/13 9:21:25:227 IST] 00000036 SystemErr  R ... 49 more 
[2/21/13 9:21:25:227 IST] 00000036 SystemErr  R Caused by: java.security.cert.CertPathValidatorException: The certificate issued by OU=Equifax Secure Certificate Authority, O=Equifax, C=US is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error 
[2/21/13 9:21:25:227 IST] 00000036 SystemErr  R at com.ibm.security.cert.BasicChecker.<init>(BasicChecker.java:111) 
[2/21/13 9:21:25:228 IST] 00000036 SystemErr  R at com.ibm.security.cert.PKIXCertPathValidatorImpl.engineValidate(PKIXCertPathValidatorImpl.java:176) 
[2/21/13 9:21:25:228 IST] 00000036 SystemErr  R at com.ibm.security.cert.PKIXCertPathBuilderImpl.myValidator(PKIXCertPathBuilderImpl.java:732) 
[2/21/13 9:21:25:228 IST] 00000036 SystemErr  R at com.ibm.security.cert.PKIXCertPathBuilderImpl.buildCertPath(PKIXCertPathBuilderImpl.java:649) 
[2/21/13 9:21:25:228 IST] 00000036 SystemErr  R at com.ibm.security.cert.PKIXCertPathBuilderImpl.buildCertPath(PKIXCertPathBuilderImpl.java:595) 
[2/21/13 9:21:25:228 IST] 00000036 SystemErr  R at com.ibm.security.cert.PKIXCertPathBuilderImpl.engineBuild(PKIXCertPathBuilderImpl.java:357) 
[2/21/13 9:21:25:228 IST] 00000036 SystemErr  R ... 51 more 
[2/21/13 9:21:25:228 IST] 00000036 SystemErr  R Caused by: java.security.cert.CertPathValidatorException: Certificate chaining error 
[2/21/13 9:21:25:230 IST] 00000036 SystemErr  R at com.ibm.security.cert.CertPathUtil.findIssuer(CertPathUtil.java:298) 
[2/21/13 9:21:25:230 IST] 00000036 SystemErr  R at com.ibm.security.cert.BasicChecker.<init>(BasicChecker.java:108) 
[2/21/13 9:21:25:230 IST] 00000036 SystemErr  R ... 56 more 

此外,我一直在獲取https錯誤,當我打開我的項目在鉻。我如何解決它? 請幫忙。

回答

3

您正嘗試向使用SSL的服務器發送電子郵件(本例中看起來像gmail), WebSphere不信任證書,這就是您失敗的原因。

您需要將Google證書導入到WebSphere的信任庫中,它應該可以爲您工作。

最簡單的方法是使用Retrieve from port,它允許您提供主機名和端口,WebSphere將爲您獲取證書。

+0

在這種情況下主機名稱是什麼?它是localhost? – 2013-02-21 08:27:07

+0

stmp.gmail.com(或任何smtp服務器的主機名) – 2013-02-21 08:27:41

+0

我試過你的方法,但它不起作用,WebSphere未能獲得證書。任何方式感謝您的努力 – 2013-02-21 08:49:50

0

上面清清楚楚地寫着主機和日誌中的端口: DEBUG SMTP:試圖連接到主機「smtp.gmail.com」,端口465

所以儘量端口。

相關問題