diff --git a/src/amqp_connection.erl b/src/amqp_connection.erl index b0dd1680..d6d044fb 100644 --- a/src/amqp_connection.erl +++ b/src/amqp_connection.erl @@ -168,15 +168,16 @@ start(AmqpParams) -> %% application controller is in the process of shutting down the very %% application which is making this call. ensure_started() -> - case application_controller:get_master(amqp_client) of - undefined -> - case amqp_client:start() of - ok -> ok; - {error, {already_started, amqp_client}} -> ok; - {error, _} = E -> throw(E) - end; - _ -> - ok + [ensure_started(App) || App <- [xmerl, amqp_client]]. + +ensure_started(App) -> + case application_controller:get_master(App) of + undefined -> case application:start(App) of + ok -> ok; + {error, {already_started, App}} -> ok; + {error, _} = E -> throw(E) + end; + _ -> ok end. %%---------------------------------------------------------------------------