activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Tarau <adrian.ta...@gmail.com>
Subject Re: Transport Exceptions close the connection
Date Tue, 29 May 2007 19:04:53 GMT

I'm totally confused. I removed the failover protocol
(connectionFactory.setBrokerURL("vm://localhost"); instead of
connectionFactory.setBrokerURL("failover:vm://localhost");

An now I get this exception, TransportDisposedIOException, every time when a
Session is created. It happens right from the start.

Am I doing something wrong? Again, I have ActiveMQ 4.1.1
Thanks.


com.daxtechnologies.sams.exception.SamsManagerException: Cannot schedule
task in queue 'Error Queue <error>' 
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueue.internalSchedule(AbstractSamsManagerQueue.java:301)
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueue.schedule(AbstractSamsManagerQueue.java:259)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues.scheduleError(SamsManagerQueues.java:63)
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueueConsumerCallback.consume(AbstractSamsManagerQueueConsumerCallback.java:46)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues$AbstractQueueRunnable.consume(SamsManagerQueues.java:462)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues$AbstractQueueRunnable.throttleQueue(SamsManagerQueues.java:434)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues$AbstractQueueRunnable.run(SamsManagerQueues.java:473)
	at
com.daxtechnologies.sams.manager.SamsManagerThreadPool$WorkerThead.run(SamsManagerThreadPool.java:206)
Caused by: javax.jms.JMSException: Peer (vm://localhost#1) disposed.
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:58)
	at
org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1157)
	at
org.apache.activemq.ActiveMQSession.asyncSendPacket(ActiveMQSession.java:1651)
	at
org.apache.activemq.ActiveMQMessageProducer.<init>(ActiveMQMessageProducer.java:100)
	at
org.apache.activemq.ActiveMQSession.createProducer(ActiveMQSession.java:778)
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueue.internalSchedule(AbstractSamsManagerQueue.java:277)
	... 7 more
Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://localhost#1) disposed.
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:86)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:47)
	at
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
	at
org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1155)
	... 11 more
com.daxtechnologies.sams.exception.SamsManagerQueueException: Cannot create
queue, reason
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueue.initQueue(AbstractSamsManagerQueue.java:473)
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueue.initialize(AbstractSamsManagerQueue.java:361)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues.getDomainQueue(SamsManagerQueues.java:202)
	at
com.daxtechnologies.sams.manager.SamsManagerContactQueue$ContactQueueConsumerCallback.getNextQueue(SamsManagerContactQueue.java:31)
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueueConsumerCallback.consume(AbstractSamsManagerQueueConsumerCallback.java:28)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues$AbstractQueueRunnable.consume(SamsManagerQueues.java:462)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues$AbstractQueueRunnable.throttleQueue(SamsManagerQueues.java:434)
	at
com.daxtechnologies.sams.manager.SamsManagerQueues$AbstractQueueRunnable.run(SamsManagerQueues.java:473)
	at
com.daxtechnologies.sams.manager.SamsManagerThreadPool$WorkerThead.run(SamsManagerThreadPool.java:206)
Caused by: javax.jms.JMSException: Peer (vm://localhost#1) disposed.
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:58)
	at
org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1157)
	at org.apache.activemq.ActiveMQSession.<init>(ActiveMQSession.java:227)
	at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:279)
	at
com.daxtechnologies.sams.manager.SamsManagerJMS.createSession(SamsManagerJMS.java:311)
	at
com.daxtechnologies.sams.manager.AbstractSamsManagerQueue.initQueue(AbstractSamsManagerQueue.java:470)
	... 8 more
Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer
(vm://localhost#1) disposed.
	at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:86)
	at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:47)
	at
org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
	at
org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1155)
	... 12 more



James.Strachan wrote:
> 
> On 5/21/07, Adrian Tarau <adrian.tarau@gmail.com> wrote:
>>
>> Hello,
>>
>> I have the following problem : A connection(embedded broker, vm
>> transport)
>> is created and then a few sessions. I poll for messages, with my own
>> threads
>> in order to do throttling. One thing that confuses me is : if an
>> exception
>> occurs somewhere in the transport(for example an interrupt on the
>> consuming
>> thread) , the connection is closed with all the sessions and
>> consumers/producers.
> 
> AFAIK thread interupt exceptions won't close a
> connection/session/transport. You sure its not some other underlying
> excpetion?
> 
> 
>> I was able to listen for such an exceptions(with
>> Connection.setExceptionListener(...)) and recreate the connection. I
>> tried
>> also with connectionFactory.setBrokerURL("failover:vm://localhost") which
>> supposed to fix problems like this one, and to reconnect, but is not
>> working
>> as espected.
> 
> When using vm:// you should never really need failover, since the
> broker is in the same JVM. Failover is intended for use with TCP where
> a remote broker may fail.
> 
> Even if you were having a transport level exception (which shouldn't
> really happen with vm:// but maybe there's a bug & we should catch &
> handle InteruptedException better) then failover does the re-creation
> of all the connection/sessions for you so there's no real point trying
> to replicate that yourself (as you'll be opening all kinds of cans of
> worms, like figuring out which messages, transactions &
> acknowledgements were in progress & re-submitting them - all of which
> failover: already handles.
> 
> BTW 4.0.2 is quite old, I'd recommend upgrading to 4.1.1
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Transport-Exceptions-close-the-connection-tf3791363s2354.html#a10860456
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message