The NPE will be occuring on the broker and causing it to close the connection with the error details noted, which your C++ program then prints.
You look to be disabling SASL on the client. Is your broker actually set up to allow unauthenticated access? I think its possible this recent Artemis JIRA could be related: https://issues.apache.org/jira/browse/ARTEMIS-2431. Enabling the protocol trace output (set environment variable PN_TRACE_FRM=1) would make the protocol interaction occuring clear. Robbie On Tue, 30 Jul 2019 at 05:38, ishaan_tantra <[email protected]> wrote: > > Platform - Windows 10 - x64 > > Library qpid-proton:0.28.0 > > Visual C++ 2017 (15.9.14) > > I am attempting to connect to ActiveMQ Artemis using AMQP 1.0 protocol using > Apache Qpid-Proton library; I'm using its C++ binding. > > After I connect to Artemis my client gets disconnected throwing the > exception > > > amqp:internal-error: Unrecoverable error: NullPointerException > > on running the `on_connection_open` method. > > In the Artemis console I had observed that after successfully executing > `on_container_start` method; in the `Connection` tab a new connection entry > is inserted with all proper values. Executing `on_connection_open` method > return exception. > > //is a static method > bool MessageQueue::initalize_message_queue(void) > { > try { > proton::container(mq).run(); > return true; > } > catch (const std::exception& ex) { > #ifdef _DEBUG > spdlog::error("Exception in > MessageQueue::initalize_message_queue. > Exception : {}", ex.what()); > #endif // _DEBUG > LOG_ERROR << ex.what(); > return false; > } > } > > void MessageQueue::on_container_start(proton::container& container) > { > try { > proton::connection_options connection_option; > if (not this->user_name.empty()) > connection_option.user(this->user_name); > if (not this->password.empty()) > connection_option.password(this->password); > connection_option.sasl_enabled(false); > container.connect(this->broker_uri, connection_option); > } > catch (const std::exception& ex) { > #ifdef _DEBUG > spdlog::error("Exception in MessageQueue::on_container_start. > Exception : {}", ex.what()); > #endif // _DEBUG > LOG_ERROR << ex.what(); > } > } > > void MessageQueue::on_connection_open(proton::connection& conn) > { > try { > conn.open_receiver(this->endpoint); > conn.open_sender(this->endpoint); > } > catch (const std::exception& ex) { > #ifdef _DEBUG > spdlog::error("Exception in MessageQueue::on_connection_open. > Exception : {}", ex.what()); > #endif // _DEBUG > LOG_ERROR << ex.what(); > } > } > > // **I am receiving error here** > void MessageQueue::on_connection_error(proton::connection &connection) > { > #ifdef _DEBUG > spdlog::error("Caught Error in MessageQueue::on_connection_error. > Error > : {}", connection.error().what()); > #endif // _DEBUG > LOG_ERROR << connection.error().what(); > } > > > Error Output : > > Caught Error in MessageQueue::on_connection_error. Error : > amqp:internal-error: Unrecoverable error: NullPointerException > > As per my knowledge NullPointerException belong to languages operating on > JVM or any such runtime engine. It is not something native to C++. > > > > -- > Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
