activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Shannon <christopher.l.shan...@gmail.com>
Subject Re: Exception when stopping an embedded broker
Date Fri, 19 Jun 2015 11:20:55 GMT
There should be a nested exception that displays what the real error is.
The BrokerStoppedException is the result of another error and it is hard to
tell what is going on without the real exception causing the issues.  Is
there any more to the stack trace?

On Fri, Jun 19, 2015 at 6:36 AM, pubudu gunawardena <pubudupg@gmail.com>
wrote:

> Hi All,
>
> I am using ActiveMQ version 5.11.1. Following is a simple code snippet
> which reproduces the problem I am getting. (what I am trying to
> implement is a restart, but the exceptions are thrown when stopping).
>
>
> import org.apache.activemq.ActiveMQConnection;
> import org.apache.activemq.ActiveMQConnectionFactory;
> import org.apache.activemq.broker.BrokerService;
> import org.apache.activemq.network.jms.JmsQueueConnector;
> import org.apache.activemq.network.jms.OutboundQueueBridge;
>
> public class StopTest {
>     public static void main(String[] args) throws Exception {
>         BrokerService broker = new BrokerService();
>         broker.addConnector("tcp://localhost:61617");
>
>         JmsQueueConnector connector = new JmsQueueConnector();
>         connector.setOutboundQueueConnectionFactory(new
> ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL));
>         OutboundQueueBridge outboundQueueBridge = new
> OutboundQueueBridge("queue");
>         connector.setOutboundQueueBridges(new OutboundQueueBridge[] {
> outboundQueueBridge });
>         broker.setJmsBridgeConnectors(new JmsQueueConnector[] { connector
> });
>
>         broker.start();
>         broker.waitUntilStarted();
>         broker.stop();
>         broker.waitUntilStopped();
>     }
> }
>
>
> I get the following exception
>
> Exception in thread "ActiveMQ VMTransport: vm://localhost#1-1"
> org.apache.activemq.broker.BrokerStoppedException: Broker
> BrokerService[localhost] is being stopped
>     at
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:193)
>     at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
>     at
> org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
>     at
> org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:248)
>     at
> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133)
>     at
> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at java.lang.Thread.run(Thread.java:745)
>
> Can someone point out to me what I am not doing correctly?
>
> --
> Thanks,
> Pubudu
>

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