You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Srikrishna Erra (Jira)" <ji...@apache.org> on 2020/10/05 09:54:00 UTC
[jira] [Comment Edited] (AMQCPP-653) ActiveMQ C++ 3.9.3 Client
returning Exception having message "Pointer operator& - Pointee is NULL."
[ https://issues.apache.org/jira/browse/AMQCPP-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17207962#comment-17207962 ]
Srikrishna Erra edited comment on AMQCPP-653 at 10/5/20, 9:53 AM:
------------------------------------------------------------------
Here is our application code that interacts with AMQ C++ 3.9.3 to connect with Broker
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
shared_ptr<cms::ConnectionFactory> factory_;
shared_ptr<cms::Connection> connection_;
bool running_;
std::string connectmessage_;
stringstream JMSURL;
JMSURL << "failover://(" << protocol << "://"
<< broker << ":" << port
<< "?jms.watchTopicAdvisories=false)"
<< "?startupMaxReconnectAttempts=6&initialReconnectDelay=500"
<< "&maxReconnectAttempts=-1&maxReconnectDelay=30000";
while (!running_)
{
try
{
factory_ = shared_ptr<ConnectionFactory>(ConnectionFactory::createCMSConnectionFactory(JMSURL.str()));
connection_ = shared_ptr<Connection>(factory_->createConnection());
connection_->start();
LOG4CXX_DEBUG(logger(), "Broker Connection started"); running_ = true; }
catch (CMSException& e)
{
if (connection_)
{
connection_->close(); }
running_ = false;
sleep(10);
}
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
was (Author: erra_krishna):
Here is our application code that interacts with AMQ C++ 3.9.3 to connect with Broker
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
shared_ptr<cms::ConnectionFactory> factory_;
shared_ptr<cms::Connection> connection_;
bool running_;
std::string connectmessage_;
stringstream JMSURL;
JMSURL << "failover://(" << protocol << "://"
<< broker << ":" << port
<< "?jms.watchTopicAdvisories=false)"
<< "?startupMaxReconnectAttempts=6&initialReconnectDelay=500"
<< "&maxReconnectAttempts=-1&maxReconnectDelay=30000";
while (!running_)
{
try
{
factory_ = shared_ptr<ConnectionFactory>(ConnectionFactory::createCMSConnectionFactory(JMSURL.str()));
connection_ = shared_ptr<Connection>(factory_->createConnection());
connection_->start();
LOG4CXX_DEBUG(logger(), "Broker Connection started");
running_ = true;
}
catch (CMSException& e)
{
if (connection_)
{
connection_->close();
}
running_ = false;
sleep(10);
}
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ActiveMQ C++ 3.9.3 Client returning Exception having message "Pointer operator& - Pointee is NULL."
> ---------------------------------------------------------------------------------------------------
>
> Key: AMQCPP-653
> URL: https://issues.apache.org/jira/browse/AMQCPP-653
> Project: ActiveMQ C++ Client
> Issue Type: Bug
> Affects Versions: 3.9.3
> Environment: OS: SLES 11 SP3
> ActiveMQ C++ Library 3.9.3
> ActiveMQ sever 5.15.9
> Reporter: Srikrishna Erra
> Assignee: Timothy A. Bish
> Priority: Major
>
> We have a C++ Application using ActiveMQ C++ 3.9.3 Library to interact ActiveMQ Server.
> We are testing failover and failback functionality with Master and Slave ActiveMQ Borkers.
> #1. Starting with, Master Broker Up and Slave Borker Down, we could scuccessfully establish connection and send/receive messages.
> #2. Tested Failover (switch to Slave Broker) with Master Broker Down and Slave Broker Up. We could successully establish connection and send/revceive messages
> #3. Tested Failback (switch back to Master Broker) with Master Broker Up and MakingSlave Broker Down again. We could successully establish connection and send/revceive messages
> #4. Our C++ application being running, Master Broker being Up and Slave being down, the setup was intact for few days with no activity.
>
> After few days, we have just stoped and started our application with still Master Broker being Up and Slave being down. Our application's stop and start was clean.
>
> But we just got Expception now. Here are the Details.
> ==========================================================
> Process ID: 14606
> Threads ID: 14612 ==> Connecting with Master Broker which is Up. So, no issues.
> 14613 ==> Connecting with Slave Broker which is Down. Got an Exception.
> ==========================================================
>
> Here are the Logs:
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> [ 0:_*14606*_:*14612*] DEBUG JMSSessionFactory - Broker URL:failover://(tcp://tdd5rcdam01:61616?jms.watchTopicAdvisories=false)?startupMaxReconnectAttempts=6&initialReconnectDelay=500&maxReconnectAttempts=-1&maxReconnectDelay=30000
> [ 0:_*14606*_:*14613*] DEBUG JMSSessionFactory - Broker URL:failover://(tcp://tdt5wsdam01:61616?jms.watchTopicAdvisories=false)?startupMaxReconnectAttempts=6&initialReconnectDelay=500&maxReconnectAttempts=-1&maxReconnectDelay=30000
> [ 0:_*14606*_:*14612*] DEBUG JMSSessionFactory - Broker Connection started
> [ 0:_*14606*_:*14613*] ERROR JMSSessionFactory - JMSSessionFactory could not be created, verify ActiveMQ server is configured correctly and running.Message from CMS is: Connection refused
> [ 0:_*14606*_:*14613*] ERROR JMSHandler - JMSHandler caught exception: Pointer operator& - Pointee is NULL.
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> We got 2 Exceptions here on the thread that is interacting with Slave Broker which is Down.
> #1. Connection refused. But there was a re-try attemepted.
> #2. NULL Pointer Exception --> Pointer operator& - Pointee is NULL.
>
> Could you verify this and assist us on next actions.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)