设置电子邮件通知Wso2EMM(Setting Up Email Notification For

2019-09-28 02:50发布

我想配置WSO2 EMM电子邮件通知一下,我已经与它有问题。 我跟着指示给这里去

<EMM_HOME>/repository/conf/axis2/axis2.xml` and do this


    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
    <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
    <parameter name="mail.smtp.port">587</parameter>
    <parameter name="mail.smtp.starttls.enable">true</parameter>
    <parameter name="mail.smtp.auth">true</parameter>
    <parameter name="mail.smtp.user">synapse.demo.0</parameter>
    <parameter name="mail.smtp.password">mailpassword</parameter>
    <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
    </transportSender>

按照指示在这里 ,然后,我一直得到这个错误

 [2016-05-08 09:39:42,800] ERROR {org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl} - Error occurred while delivering the message, subject: 'You have successfully been registered in WSO2 EMM', to: 'sososo@gmail.com' org.apache.axis2.AxisFault: Error generating mail message at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226) at org.apache.axis2.transport.mail.MailTransportSender.sendMessage(MailTransportSender.java:184) at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442) at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149) at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:511) at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:488) at org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl$EmailSender.run(EmailSenderServiceImpl.java:117) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) 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: org.apache.axis2.AxisFault: Error creating mail message or sending it to the configured server at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226) at org.apache.axis2.transport.mail.MailTransportSender.sendMail(MailTransportSender.java:505) at org.apache.axis2.transport.mail.MailTransportSender.sendMessage(MailTransportSender.java:175) ... 12 more Caused by: 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:1420) at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1408) at com.sun.mail.smtp.SMTPTransport.ehlo(SMTPTransport.java:847) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:384) at javax.mail.Service.connect(Service.java:297) at javax.mail.Service.connect(Service.java:156) at javax.mail.Service.connect(Service.java:105) at javax.mail.Transport.send0(Transport.java:168) at javax.mail.Transport.send(Transport.java:98) at org.apache.axis2.transport.mail.MailTransportSender.sendMail(MailTransportSender.java:494) ... 13 more Caused by: 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 sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1916) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1472) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:213) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:913) at sun.security.ssl.Handshaker.process_record(Handshaker.java:849) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1035) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:721) at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122) at com.sun.mail.util.TraceOutputStream.write(TraceOutputStream.java:101) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1418) ... 22 more Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385) at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292) at sun.security.validator.Validator.validate(Validator.java:260) at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1454) ... 33 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196) at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380) ... 39 more 

所以,我的配置后axis2_client.xml with the transportSender在出和评论它axis2.xml我得到这个错误

 ERROR {org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl} - Error occurred while delivering the message, subject: 'You have successfully been registered in WSO2 EMM', to: 'osososos@gmail.com' org.apache.axis2.AxisFault: The system cannot infer the transport information from the mailto:ososososo@gmail.com URL. at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81) at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:288) at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:249) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149) at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:511) at org.apache.axis2.client.ServiceClient.fireAndForget(ServiceClient.java:488) at org.wso2.carbon.email.sender.core.service.EmailSenderServiceImpl$EmailSender.run(EmailSenderServiceImpl.java:117) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) 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) 

和我的配置看起来像一个例子

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
    <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
    <parameter name="mail.smtp.port">587</parameter>
    <parameter name="mail.smtp.starttls.enable">true</parameter>
    <parameter name="mail.smtp.auth">true</parameter>
    <parameter name="mail.smtp.user">AppManager</parameter>
    <parameter name="mail.smtp.password">thegmailpassword</parameter>
    <parameter name="mail.smtp.from">sosososoo@gmail.com</parameter>
</transportSender>

Answer 1:

请移动的mailto配置从axis2.xml到axis2_client.xml。 你可以找到下面给出一个简单的配置。

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
    <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
    <parameter name="mail.smtp.port">587</parameter>
    <parameter name="mail.smtp.starttls.enable">true</parameter>
    <parameter name="mail.smtp.auth">true</parameter>
    <parameter name="mail.smtp.user">synapse.demo.0</parameter>
    <parameter name="mail.smtp.password">*********</parameter>
    <parameter name="mail.smtp.from">********</parameter>
</transportSender>


文章来源: Setting Up Email Notification For Wso2EMM
标签: wso2 wso2-emm