Friday, October 8, 2010

Using GMail as Mail Server for Oracle SOA Suite 11g Notifications

Lucas Jellema has a good post about configuring SOA Suite 11g for sending email notifications with Google Mail, but unluckily, as he also noted, it was not working anymore. Nevertheless, that post demonstrated that Gmail could work as SMTP server for Oracle SOA and inspired me to dig more. In this post, I will share my configuration and the steps that I have made to have a working GMail SMTP server. The following are my suggested steps:
  1. Configure Workflow Notification Properties
  2. Configure Email Driver Properties
  3. Import the GMail's SSL certificate into Java keystore
  4. Remove "\server\lib\DemoTrust.jks" in setDomainEnv.cmd

Configure Workflow Notification Properties

Right-click soa-infra > SOA Administration > Workflow Notification Properties
Set Workflow Notification to "All" or "Email".
Replace the "" and "" with your own gmail address. You could replace both with just a single account. Don't be alarmed with my email address configuration that doesn't end with "" because I have subscribe to Google Apps where I could have a customized email address.

Configure Email Driver Properties

Please see my configuration below which is presented as is for your reference.
Note that I am not using cleartext password but an encrypted indirect password as follows:

Import the GMail's SSL certificate into Java keystore

Follow the instructions on the following site up to the step of importing of the certificate to the keystore. Needless to say, import the certificate to the same JAVA_HOME that runs your weblogic server instance.

Remove "\server\lib\DemoTrust.jks" in setDomainEnv.cmd

It seems that this command argument is affecting the way Weblogic locates trust as described in the following document: How WebLogic Server Locates Trust. With that argument, weblogic is not looking trust into JDK cacerts keystores.

Quick Testing...

Goto SOA Infrastructure>Service Engine>Human Workflow

Click "Notification Management" tab then click "Send Test Notification"... Enter something like the following values. Ensure that you gave a valid "Send To" email address.
Voila! Email is received accordingly...
Cheers and Thanks to Lucas!


  1. Hi ,
    To begin , this is a great post, Thanks,

    I did not have to remove "\server\lib\DemoTrust.jks" in setDomainEnv.cmd . This was because i added gmail.cert to DemoTrust.jks too. The password for adding is DemoTrustKeyStorePassPhrase.

  2. Hi Asish!

    That info is valuable.

    Thanks for the feedback,
    Rommel Pino

  3. Updated the link on importing Gmail SSL certificate.

  4. Its very helpful.

    I have done all the above mentioned steps. But i am getting following error. Please let me know how to resolve the issue?
    Error while sending notification. Error while sending notification to email. Check the underlying exception and fix it. ; Error while sending notification. Error while sending notification to email. Check the underlying exception and fix it. ; EJB Exception: : java.lang.NullPointerException at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint( at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed( at at at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed( at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit( at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback( at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke( at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed( at com.bea.core.repacka