activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruben de Gooijer <r.degooi...@onehippo.com>
Subject BrokerStoppedException, during embedded broker restart
Date Thu, 07 May 2009 17:42:24 GMT
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:

<amq:broker
        useShutdownHook="false"
        useJmx="false"
        persistent="true"
        brokerName="localhost" >
        <amq:transportConnectors>
            <amq:transportConnector
uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=-1" />
            <amq:transportConnector
uri="vm://localhost:61616?wireFormat.maxInactivityDuration=-1" />
        </amq:transportConnectors>
        <amq:persistenceAdapter>
            <amq:kahaPersistenceAdapter maxDataFileLength="33554432"/>
        </amq:persistenceAdapter>
    </amq:broker>
</beans>

Kind regards,
Ruben

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message