1

I am trying to configure the email notification bit for WSO2 EMM and I've been having problem with it. I followed the instruction give here to go to

<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>

As Directed Here and then, I kept getting this error

[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

So, After configuring my axis2_client.xml with the transportSender and commenting it out in axis2.xml I'm getting this error

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)

And an example of how my config looks like

<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>
Community
  • 1
  • 1
Tonespy
  • 3,257
  • 7
  • 26
  • 52

1 Answers1

0

Please move the mailto configuration to axis2_client.xml from axis2.xml. You can find a sample configuration given below.

<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>
Kamidu Punchihewa
  • 1,241
  • 10
  • 18
  • And then, I started getting this error after commenting out this line in axis2.xml and adding it to axis2_client.xml `Error occurred while delivering the message, subject: 'You have successfully been registered in WSO2 EMM', to: 'sosososos@gmail.com' org.apache.axis2.AxisFault: The system cannot infer the transport information from the mailto:s@gmail.com URL.`oosososos. And I updated my question too – Tonespy May 08 '16 at 20:00
  • Can I know the exact version of EMM server you are working with ? And What kind of a Environment is the server is hosted ? – Kamidu Punchihewa May 08 '16 at 20:21
  • V2.0.1 and I've been trying to set this thing up for the past 2months, hitting different rock as I advance. I set it up on the V1.0.0 last two years until someone mistakenly deleted my server hosting it, so now I'm setting up v2.0.1 and it's freaking hard and your documentation, sorry to say, it's really, really misleading – Tonespy May 08 '16 at 20:24
  • Noted, We'll keep in that our mind for the next release. Please make sure all the SLL certificates are added to the key stores including the ones are self singed for Ios configurations and the provided by the CA for the server/domain of the server. – Kamidu Punchihewa May 08 '16 at 20:28
  • Ohw, that one was the particular one that had me for that two months. Look here http://stackoverflow.com/questions/36546201/setting-up-wso2-emm?noredirect=1#comment61714152_36546201 and then, I was finally able to switch back to just basic `HTTP` yesterday. Fortunately, I started having `ThriftAuthenticationSer‌​viceComponent` issue. I decided to stick with Crashlytics for distributing the apps but, we need to enrol devices right? And this is v2.0.1 we can't set user password, it's sent to there email. Which isn't working. Please, any fix would be appreciated. Thanks. – Tonespy May 08 '16 at 20:32
  • You can change the password with the admin user or using the carbon console with the user who has the permissions enabled. You need to have the related SLL certificates inside the keystores in order to enable Ios enrollment and secured transports of any kind. you can follow these articles to archive the above. http://wso2.com/library/knowledge-base/2011/08/adding-ca-certificate-authority-signed-certificate-wso2-products/ , http://wso2.com/library/174/ – Kamidu Punchihewa May 08 '16 at 20:39
  • It seems this is a knows issue in EMM 2.0.1 please utilize the QR code in device management to enroll the device.You can provide a password for users using admin account and ask them to change it after login.Thanks – Kamidu Punchihewa May 10 '16 at 10:47
  • Let's continue the discussion here if you don't mind. I got the message you sent using my EMM Server yesterday. http://chat.stackoverflow.com/rooms/111594/wso2emm – Tonespy May 11 '16 at 05:46
  • Sorry, I got the message you sent using my EMM Server yesterday ?? which message are u referring to – Kamidu Punchihewa May 11 '16 at 11:31
  • I saw a message being sent from the EMM server and since, you were debugging with me. So, I thought it was from you using the server to check if sending message to users works fine – Tonespy May 11 '16 at 11:33
  • Yeah it was me. i send that to my own device :D – Kamidu Punchihewa May 11 '16 at 11:42
  • Okay. Mind coming into the Chat room here http://chat.stackoverflow.com/rooms/111594/wso2emm ? – Tonespy May 11 '16 at 11:45