Wednesday, July 11, 2012

AIA Error Handler Email Config Tricks

I had to chase down a problem with an AIA error handler failing to send email today. Boy, it has been a few months since I last touched it. Everything got blurry. I had to relearn quite a bit. Let me document the tricks before I forget again.

1.      First of all, .under {AIA instance home}/AIAMetaData/config (e.g. /app/oracle/product/fmw/AIACCB/aia_instances/AIACCB/AIAMetaData/config)
make sure the two XML files are configured correctly.
2.      Follow this link to update the AIA config:
(1)    Browse to the folder at $AIA_HOME/aia_instances/$INSTANCE_NAME/bin.
(2)    Source the file by executing the following command:
(3)    Browse to the folder at $AIA_HOME/aia_instances/$INSTANCE_NAME/config and open the deployment plan file, UpdateMetaDataDP.xml.
(4)    Update the file UpdateMetaDataDP.xml by inserting include tags for each resource group that you want to add to the MDS:

a.      To upload all the files under "AIAMetaData", add the following:
<include name ="**"/>
b.      To upload the files copied to "AIAComponents/ApplicationObjectLibrary/SEBL/schemas" folder, add the following:
<include name ="AIAComponents/ApplicationObjectLibrary/SEBL/schemas/**"/>
In the include tag, the folder path must be relative to the folder AIAMetaData.
(5)    Browse to AIA_HOME/Infrastructure/Install/config. Execute the script UpdateMetaData.xml by typing the command:
ant -f UpdateMetaData.xml
3.      (Trick 1) Due to an AIA bug, when you run (5) above, make sure {AIA home}/lib/aia.jar (/app/oracle/product/fmw/AIACCB/aia.jar) is available. HOWEVER, after you finish step (5), make sure you hide that aia.jar (rename to aia.jar.bak), then bounce your SOA server! It’s ironic that you have to hide aia.jar in order for AIA to work! BUT, remember next time when you need to run AIA update again, step (5) above, make sure you unhide your aia.jar in order for the update to work. Also, double check on step (4) carefully, I burned several hours in the past due to a careless file path problem in the XML file on step (4).

4.      (Trick 2) Say, you set up your error tables, for that “Role” column, you enter the user name (e.g. “foo”) that will receive the email notifications. According to AIA doc, you need to configure that user’s email under {your AIA URL}/sdpmessaging/userprefs-ui (if your AIA console is, then your link is However, that didn’t quite work for me either.
What you really need do is to go to weblogic console, under security realm, users, set the email for that user  (say “foo”), click “attribute” tab, then find mail (2nd page), and enter email address over there. That is what worked for me! The only that appears to be working under "sdpmessaging/userprefs-ui " is if you set one user as the default channel (I used AIAIntegrationAdmin). 

5.      (Trick 3), one useful trick to debug your email problem is under “em” console.
Expand “User Messaging Service” (last link on the left panel)
Click on “usermessagingserver (WLS_SOA1)”
On the right panel, look on the top left corner, find the little drop-down menu (under “usermessaingserver” bold letters),
select “Message Status” from the drop-down menu
Hopefully, you’ll see a list of message action entries.
Click on the one you are interested (failed, succeeded)

I have had luck to find out the root cause of email issues from this page. In the case, when it shows failed, I can check the bottom to find out the detailed reason.
Today, I found one showed succeeded; however, we didn’t get any emails. So that prompted me to login to the putty console, and run the mail command, like “mail”, directly, where ““ is the address that the server claimed to have sent successfully. However, my putty console test shows the recipient never get the email. As it finally turned out that email “” happens to be a distribution list and it was not set up properly on the server.