2 Replies Latest reply on Oct 1, 2014 9:09 AM by Darren Jones

    Is there a way to force the messaging subsystem to completely initialize before servlets are deployed?

    Darren Jones Newbie

      I am using a third party servlet (Atmosphere). In the web.xml it is had <load-on-startup>0</load-on-startup> so that it is initialized on startup.

       

      In the servlet's initialize() code, it looks up a JMS connection factory via JNDI. Sometimes the lookup fails with a NameNotFoundException because it appears that the messaging subsystem has not finished initializing and binding all of the <connection-factory>'s into JNDI.

       

      I don't have a reliable test case because this is an intermittent problem and occurrence varies according to machine spec (as expected with a race condition such as this).

       

      Is there a way to force the messaging subsystem to complete its initialization before a web app is deployed? Or is there some other way of ensuring that a connection factory/topic is available in JNDI before a servlet is initialized?