activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timplusplus <>
Subject activemq-cpp Access violation closing consumer session object
Date Fri, 06 Mar 2009 20:45:50 GMT

Hi everyone,

I have a working C++ client built off of ActiveMQ-CPP 2.4 (WindowsXP,
MSVC++, APR 1.3.3) which connects to a standalone ActiveMQ server (5.1.0),
can publish messages, subscribe to messages and disconnect just fine.  

I have attempted to construct my own reconnecton mechanism and for the most
part have it working pretty well.  I have my C++ client publishing messages
(1 per second) to the server where a Java client subscribes to them.  I also
have a script that forcefully kills/restarts my ActiveMQ server every 60

My problem is with the C++ client disconnecting after a forceful kill of the
ActiveMQ server.  Every once in a while during the delete( consumerSession
); call, a Windows exception: "Unhandled Exception!  Access Violation!" will

It seems that at some point during these disconnections, there is a dangling
pointer left in my consumerSession object.  During the
ActiveMQSession::close() method,  cms::Closeable Iterator attempts to
access:  iter->next()   and the Access Violation exception is thrown.  

My first question to anyone kind enough to read all this is have any of you
ever experienced anything similar?  

One of my biggest problems is that replication of this issue is quite
difficult.  For the most part, the disconnect/reconnect functionality I have
works great.  EVery now and then (I am thinking it's bad timing somewhere),
I get this exception trying to close the consumerSession's closeables.  

If anyone wants more info (more explanation, snippets, etc...)  please let
me know.


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message