added a better error message if there is no broker available

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@517706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-03-13 14:29:28 +00:00
parent a51a7d53e2
commit a7344588c9
1 changed files with 6 additions and 1 deletions

View File

@ -31,6 +31,11 @@ public class SingletonBrokerFacade extends LocalBrokerFacade {
}
protected static BrokerService findSingletonBroker() {
return BrokerRegistry.getInstance().findFirst();
BrokerService broker = BrokerRegistry.getInstance().findFirst();
if (broker == null) {
throw new IllegalArgumentException("No BrokerService is registered with the BrokerRegistry." +
" Are you sure there is a configured broker in the same ClassLoader?");
}
return broker;
}
}