Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 90064 invoked from network); 11 May 2009 15:57:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 May 2009 15:57:50 -0000 Received: (qmail 86222 invoked by uid 500); 11 May 2009 15:57:50 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 86155 invoked by uid 500); 11 May 2009 15:57:49 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 86145 invoked by uid 99); 11 May 2009 15:57:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 May 2009 15:57:49 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of chubrilo@gmail.com designates 209.85.219.164 as permitted sender) Received: from [209.85.219.164] (HELO mail-ew0-f164.google.com) (209.85.219.164) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 May 2009 15:57:37 +0000 Received: by ewy8 with SMTP id 8so4210661ewy.38 for ; Mon, 11 May 2009 08:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=QGHx/rFGhYTK+rA/APNpP1vpwCIAnmhmZCwkSzwEExo=; b=i5gBS0nzebOPbGgotcL1irO28gZoeqA8H/cN1cH1CuDnT8yZbRBjryQBedv/5Ay1Oh /HpCabtzxkzsF4/QuNMjODruJYVc8cjHZ47TLIvzZikyYQ1RhZ4q7szu4ShAkPLJluEA eI+WsOTgdoKO33l5GfyxwfDUFuc4Gg9CFy5nA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=x360YSdCUJn6PthB22FZ7pZMhm5s7I8dAJ3/wx0sk4RIgj7h7Gy0RDvzWZt3bjBELe lzs2qFaWtzUVk753eWZk943rbDEw3n8XHSs3j8NVCqU7/u+GDXRmi5hyn6TjgE/V3FYm oEXIP9HPqd2QiTfLw+80K2AAUhG23LOIbU/1Q= MIME-Version: 1.0 Sender: chubrilo@gmail.com Received: by 10.210.28.5 with SMTP id b5mr6819530ebb.10.1242057437116; Mon, 11 May 2009 08:57:17 -0700 (PDT) In-Reply-To: <4d2261180905071042m39cf84fcr3be89fb6b68e10ed@mail.gmail.com> References: <4d2261180905071042m39cf84fcr3be89fb6b68e10ed@mail.gmail.com> Date: Mon, 11 May 2009 17:57:17 +0200 X-Google-Sender-Auth: 830aad77c2019073 Message-ID: <36e91d9d0905110857gf224b1dx3abdfdb2ce256bbc@mail.gmail.com> Subject: Re: BrokerStoppedException, during embedded broker restart From: Dejan Bosanac To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=00151748ddc254796f0469a508c9 X-Virus-Checked: Checked by ClamAV on apache.org --00151748ddc254796f0469a508c9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Ruben, usually you'll have to initialize your broker again after it has been stopped. I just implemented the "forced" restart feature for 5.3. Take a look at http://cwiki.apache.org/confluence/display/ACTIVEMQ/How+do+I+restart+embedded+brokerand https://issues.apache.org/activemq/browse/AMQ-2245 for more details. Cheers -- Dejan Bosanac Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Thu, May 7, 2009 at 7:42 PM, Ruben de Gooijer wrote: > Hi all, > > I have a simple test using an embedded activemq 5.2.0 that performs a > system > restart. > > public class ActiveMQEmbeddedLifecycleTest extends TestCase > { > public void testLifecycle() throws Exception > { > BrokerService service = > BrokerFactory.createBroker("xbean:activemq.xml"); > service.start(); > > assertEquals(true, service.isStarted()); > > service.stop(); > service.waitUntilStopped(); > > assertEquals(false, service.isStarted()); > > service.start(); > > assertEquals(true, service.isStarted()); > > service.stop(); > } > } > > The error message I get while execution this test: > > ERROR [main] (BrokerService.java:491) - Failed to start ActiveMQ JMS > Message > Broker. Reason: org.apache.activemq.broker.BrokerStoppedException: Broker > has been stopped: org.apache.activemq.broker.BrokerService$3@164b09c > org.apache.activemq.broker.BrokerStoppedException: Broker has been stopped: > org.apache.activemq.broker.BrokerService$3@164b09c > at org.apache.activemq.broker.ErrorBroker.start(ErrorBroker.java:172) > at > > org.apache.activemq.broker.MutableBrokerFilter.start(MutableBrokerFilter.java:161) > at > org.apache.activemq.broker.BrokerService.start(BrokerService.java:468) > at > > org.hippoecm.hipposponge.test.ActiveMQEmbeddedLifecycleTest.testLifecycle(ActiveMQEmbeddedLifecycleTest.java:23) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at > org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) > at > > org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) > at > > org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) > at org.apache.maven.surefire.Surefire.run(Surefire.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at > > org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) > at > > org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) > > While searching on through the mailinglist archives I found a thread that > expresses the same problem. > > http://markmail.org/message/lqtas5u7ehnzetdt#query:+page:1+mid:fextmpkjwt64yodh+state:results > > Although it seems that there the problem has been solved, with the release > I > am using it still causes trouble. > > activemq.xml: > > useShutdownHook="false" > useJmx="false" > persistent="true" > brokerName="localhost" > > > uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=-1" /> > uri="vm://localhost:61616?wireFormat.maxInactivityDuration=-1" /> > > > > > > > > Kind regards, > Ruben > --00151748ddc254796f0469a508c9--