If an application depends on a messaging engine being available, then the messaging engine must be started before the application can be run.
If you want application server to start an application automatically, you should develop your applications to test that any required messaging engine has been started and, if needed, wait for the messaging engine. If this is technique used in a startup bean, then the startup bean method should perform the work (to test and wait) in a separate thread, using the standard WorkManager methods, so that the application server startup is not delayed.
import java.util.Iterator; import javax.management.ObjectName; import com.ibm.websphere.management.AdminService; import com.ibm.websphere.management.AdminServiceFactory; String messagingEngineName = "messagingEngineName"; // Messaging engine to check if started? for example "node01.server1-bus1" boolean meStarted = false; AdminService adminService = AdminServiceFactory.getAdminService(); while (!meStarted) { String filterString = "WebSphere®:type=SIBMessagingEngine,name=" + messagingEngineName + ",*"; boolean foundBean = false; ObjectName objectName = null; try { ObjectName objectNameFilter = new ObjectName(filterString); Iterator iter = adminService.queryNames(objectNameFilter,null).iterator(); while (iter.hasNext()) { objectName = (ObjectName) iter.next(); foundBean = true; break; } } catch (Exception e) { e.printStackTrace(); } if (foundBean) { // We have found messaging engine MBean which means it is initialized, now check if it is actually in Started state? meStarted = ((Boolean) adminService.invoke(objectName, "isStarted", null, null)).booleanValue(); } if (!meStarted) { // messaging engine is not started yet so sleep (wait) for a bit... Thread.sleep(5000); } }