Thanks for your answer Ruben... Anyway I think that the start(force) method shouldn't raise me the following exception :
> 2562 [main] ERROR > org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter - Failed to > get > destinations > java.io.IOException: Store has been closed. > at > org.apache.activemq.kaha.impl.KahaStore.initialize(KahaStore.java:460) I think it's a bug but I'd like to get the developer's opinion... ++ Ruben de Gooijer-2 wrote: > > Hi, > > I experienced the same problem, > http://mail-archives.apache.org/mod_mbox/activemq-users/200905.mbox/%3c36e91d9d0905110857gf224b1dx3abdfdb2ce256...@mail.gmail.com%3e > > The solution can be found here: > http://cwiki.apache.org/confluence/display/ACTIVEMQ/How+do+I+restart+embedded+broker > > Regards, > Ruben > > On Tue, May 12, 2009 at 9:06 AM, ffrenchm > <ffrench.mathi...@gmail.com>wrote: > >> >> Hello, >> >> I'm looking to the ActiveMQ restart methodology... Currently I saw some >> JUnit tests in which restart are done but thanks new BrokerService >> instantiation. My aim is to restart the broker with the same >> instantiation. >> IE : >> >> queuer = new BrokerService(); >> queuer.start(); >> queuer.stop(); >> queuer.start(); >> >> With the bellowed code I've this exception : >> >> 4064 [main] ERROR org.apache.activemq.broker.BrokerService - Failed to >> start ActiveMQ JMS Message Broker. Reason: >> org.apache.activemq.broker.BrokerStoppedException: Broker has been >> stopped: >> org.apache.activemq.broker.brokerservic...@9b42e6 >> >> I would like to understand why I can't restart a BrokerService with the >> same >> instantiation ? >> >> Anyway I try another code : >> queuer = new BrokerService(); >> queuer.start(); >> queuer.stop(); >> queuer.start(true); >> >> And then I've this exception : >> >> 2562 [main] ERROR >> org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter - Failed to >> get >> destinations >> java.io.IOException: Store has been closed. >> at >> org.apache.activemq.kaha.impl.KahaStore.initialize(KahaStore.java:460) >> >> Would like to know if it's a recommendation to follow to instanciate a >> new >> BrokerService before each restart or if my aim should work ? >> >> Thanks for all >> >> -- >> View this message in context: >> http://www.nabble.com/ActiveMQ-native-API-problem-%3A-BrokerService.stop---BrokerService.start%28true%29-tp23505596p23505596.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/ActiveMQ-native-API-problem-%3A-BrokerService.stop---BrokerService.start%28true%29-tp23505596p23761498.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.