More digging done... I guess this is the same issue as mentioned in http://osdir.com/ml/java.activemq.user/2005-12/msg00087.html
and it seems like the cause is that when stopping the broker an "ErrorBroker filter" is added to intercept any calls to the stopped broker (a good thing (tm)). But since the succeeding start call uses the same instance of the broker as stop did it's intercepted by the ErrorBroker filter when trying to start it thus causing a BrokerStoppedException. A solution is to create a new instance of the broker, but shouldn't actually a call to start() remove any ErrorBroker filters being placed there when stopping it? - Torgeir taf wrote: > > Hi, > I'm running activemq embedded and wants to be able to restart the broker > without terminating the host application. The broker starts fine on > application startup and calling stop() therafter also works fine, but when > trying to start it again, it results in a BrokerStoppedException. > > I've traced the call into the start method in MutableBrokerFilter where > the call to getNext().start() actually returns an ErrorBroker (which > of-course gives me a BrokerStoppedException when trying to start it). > > I would have thought that the call should be this.start(), as my broker is > successfully bound to this. > And why does getNext even return an ErrorBroker? > > Am I missing something obvious here? > > Regards, > - Torgeir Fikse > > > -- View this message in context: http://www.nabble.com/Restart-of-embedded-broker-causes-BrokerStoppedException-tp19198844p19202162.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.