Blackberry - agents are stopped

Problem
Suddenly Blackberry stops working and if you check controller log file, it may display agents are stopped.  Below mentioned error will be logged in the blackberry controller log " <server name>_CTRL_01_ <date>.log”
[10000] (07/29 09:51:55):{0xA70} 'BES instance name' agent 5 failed to initialize within 30 seconds
[30000] (07/29 09:51:55):{0xA70} 'BES instance name ' agent 5 process terminated
Even if you restart the BES services, it will again fail.

The BlackBerry Enterprise Server controller log displays the following:
[3] (03/07 12:03:25):{0x31} *** MAPI ***MailboxManager::SubsystemInitialize - AdminServices (0x80070057)
[4] (03/07 12:03:25):{0x31} *** MAPI ***MailboxManager::SubsystemInitialize - Prompting for MAPI
[2] (03/07 12:03:25):{0x31} *** MAPI ***MailboxManager::SubsystemInitialize - MAPILogonEx (0x80040102)
Cause
The BlackBerry Enterprise Server service is trying to access a Messaging Application Programming Interface (MAPI) profile that does not exist.
Resolution
Point the BlackBerry Enterprise Server service to an existing MAPI profile.
  1. Log in to the BlackBerry Enterprise Server using the BlackBerry Enterprise Server administration account (for example, BESAdmin).
  2. Open the Registry Editor by clicking Start > Run, type regedit and click OK.
  3. Locate the MAPIProfile registry entry in one of the following locations:
For BlackBerry Enterprise Server 3.5 and 3.6, go to HKEY_CURRENT_USER\Software\Research In Motion\BlackBerry Enterprise Server\Servers\<BlackBerry_Enterprise Server_name>
For BlackBerry Enterprise Server 4.0 and 4.1, go to HKEY_CURRENT_USER\Software\Research In Motion\BlackBerry Enterprise Server\Agents
If the registry path does not exist, run the BlackBerry Enterprise Server software installation while logged in with the BlackBerry Enterprise Server administration account. After the installation process is complete, in Microsoft Windows Services, start the BlackBerry Enterprise Server Service.
  1. In the MAPIProfile registry entry, the Value data field displays the name of the MAPI profile. Record this name.
  2. In the Registry Editor, go to HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\<profile_name>
where <profile_name> is the name of the MAPI profile you recorded in step 4 above.
  1. If the <profile_name> registry entry exists, proceed to step 8.
If the <profile_name> registry entry does not exist, do one of the following:
For BlackBerry Enterprise Server 3.5 and 3.6, click Start > Programs > BlackBerry Enterprise Server > Edit MAPI Profile for <BlackBerry_Enterprise_Server_name>.
For BlackBerry Enterprise Server 4.0 and 4.1, click Start > Programs > BlackBerry Enterprise Server > Edit MAPI Profile.
  1. In the MAPI Profile window, enter the BlackBerry Enterprise Server administration account mailbox (for example, BESAdmin) and the Exchange Server name. Verify that the entries resolve successfully.
  2. In Windows Services, restart the BlackBerry Enterprise Server Service.

This will sove the problem.