activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toli <t...@marketcetera.com>
Subject Re: Exception when shutting down broker
Date Tue, 12 Feb 2008 22:41:15 GMT

James, 

I'm seeing the same situation in Spring-configured broker.
After we switched from 4.0 to 5.0.0, i'm seeing unit tests (withe embedded
activemq) give this error:
14:22:47,381 [AcitveMQ Connection Worker: vm://it-oms#4] INFO 
AdvisoryConsumer - Failed to send remove command: javax.jms.JMSException:
Peer (vm://it-oms#5) disposed.
javax.jms.JMSException: Peer (vm://it-oms#5) disposed.
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
        at
org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1154)


The connection in unit tests is created with 
  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="vm://it-oms?broker.persistent=false"/>
  </bean>

What is the right way to configure ActiveMQ with Spring to make sure these
exceptions don't happen on shutdown? Setting useShutdownHook=false works for
the unit tests (and prevents the exceptions from showing up), but is there a
better way to do that w/out disabling the shutdown hook in "real" setup?


James.Strachan wrote:
> 
> It looks like a spring dependency issue in your activemq.xml - but
> nothing to worry about really. The DataSource should be closed after
> the broker is correctly shut down. Right now it looks like the JDBC
> connection pool is being closed first.
> 
> On 28/12/2007, MQ Newbie <suwei@sphsearch.sg> wrote:
>>
>> I am running 2 brokers on Master/Slave architecture. Each broker is
>> running
>> on different machine. I have the following error when i tried to stop
>> anyone
>> of the brokers. Please advise.
>>
>>
>> INFO  BrokerService                  - ActiveMQ Message Broker
>> (localhost,
>> ID:sgjms01.sphsearch.com-38092-2019316826720-0:0) is shutting down
>> INFO  TransportConnector             - Connector openwire Stopped
>> ERROR JDBCPersistenceAdapter         - Could not stop service:
>> JDBCPersistenceAdaptor(org.apache.commons.dbcp.BasicDataSource@4c221e9e).
>> Reason: java.sql.SQLException: Already closed.
>> java.sql.SQLException: Already closed.
>>         at
>> org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:66)
>>         at
>> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
>>         at
>> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.stop(DefaultDatabaseLocker.java:95)
>>         at
>> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.stop(JDBCPersistenceAdapter.java:204)
>>         at
>> org.apache.activemq.util.ServiceStopper.stop(ServiceStopper.java:41)
>>         at
>> org.apache.activemq.broker.BrokerService.stop(BrokerService.java:457)
>>         at
>> org.apache.activemq.broker.BrokerService.containerShutdown(BrokerService.java:1586)
>>         at
>> org.apache.activemq.broker.BrokerService$3.run(BrokerService.java:1564)
>> INFO  TransportConnector             - Connector vm://localhost Stopped
>> INFO  BrokerService                  - ActiveMQ JMS Message Broker
>> (localhost, ID:sgjms01.sphsearch.com-38092-2019316826720-0:0) stopped
>> Failed to shut down: java.sql.SQLException: Already closed.
>> WARN  ActiveMQConnection             - Async exception with no exception
>> listener: org.apache.activemq.transport.TransportDisposedIOException:
>> Peer
>> (vm://localhost#1) disposed.
>> org.apache.activemq.transport.TransportDisposedIOException: Peer
>> (vm://localhost#1) disposed.
>>         at
>> org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:200)
>>         at
>> org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:98)
>>         at
>> org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:36)
>> INFO  AdvisoryConsumer               - Failed to send remove command:
>> javax.jms.JMSException: Peer (vm://localhost#1) disposed.
>> javax.jms.JMSException: Peer (vm://localhost#1) disposed.
>>         at
>> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
>>         at
>> org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1154)
>>         at
>> org.apache.activemq.AdvisoryConsumer.dispose(AdvisoryConsumer.java:56)
>>         at
>> org.apache.activemq.ActiveMQConnection.cleanup(ActiveMQConnection.java:1326)
>>         at
>> org.apache.activemq.ActiveMQConnection.transportFailed(ActiveMQConnection.java:2027)
>>         at
>> org.apache.activemq.ActiveMQConnection$4.run(ActiveMQConnection.java:1663)
>>         at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>         at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>         at java.lang.Thread.run(Thread.java:619)
>> Caused by: org.apache.activemq.transport.TransportDisposedIOException:
>> Peer
>> (vm://localhost#1) disposed.
>>         at
>> org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:87)
>>         at
>> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40)
>>         at
>> org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:59)
>>         at
>> org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1152)
>>         ... 7 more
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Exception-when-shutting-down-broker-tp14522473s2354p14522473.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Exception-when-shutting-down-broker-tp14522473s2354p15444806.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message