You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Clebert Suconic (Jira)" <ji...@apache.org> on 2022/04/20 16:29:00 UTC
[jira] [Commented] (ARTEMIS-3784) NullResponseMessage_V2 cannot be cast to BindingQueryResponseMessage_V4
[ https://issues.apache.org/jira/browse/ARTEMIS-3784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17525107#comment-17525107 ]
Clebert Suconic commented on ARTEMIS-3784:
------------------------------------------
Are you using a session between multiple threads?
Each thread should have its own session.
> NullResponseMessage_V2 cannot be cast to BindingQueryResponseMessage_V4
> -----------------------------------------------------------------------
>
> Key: ARTEMIS-3784
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3784
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: ActiveMQ-Artemis-Native
> Affects Versions: 2.21.0
> Reporter: Mats Andreassen
> Assignee: Clebert Suconic
> Priority: Major
>
> Background: I'm trying to to migrate my Java 11 based application to Java 17. To facilitate this, I'm hoping to replace the "old" ActiveMQ client version 5.16.3 with the Artemis client version 2.21.0 so migration to the Jakarta namespace will be possible.
> My project embeds ActiveMQ Server to run tests and that has been stable and useful.
> So I rewrote my custom junit5 extension according to the [link doc|https://activemq.apache.org/components/artemis/documentation/latest/embedding-activemq.html] but now I'm experiencing flaky tests where the following exception crops up:
> {noformat}
> Caused by: java.lang.ClassCastException: class org.apache.activemq.artemis.core.protocol.core.impl.wireformat.NullResponseMessage_V2 cannot be cast to class org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V4 (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.NullResponseMessage_V2 and org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage_V4 are in unnamed module of loader 'app')
> at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.addressQuery(ActiveMQSessionContext.java:413)
> at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.addressQuery(ClientSessionImpl.java:794)
> at org.apache.activemq.artemis.jms.client.ActiveMQSession.lookupTopic(ActiveMQSession.java:1325)
> at org.apache.activemq.artemis.jms.client.ActiveMQSession.internalCreateTopic(ActiveMQSession.java:554)
> at org.apache.activemq.artemis.jms.client.ActiveMQSession.createTopic(ActiveMQSession.java:542)
> at no.euroskilt.server.common.queue.internal.DefaultBrokerContext.createDestination(DefaultBrokerContext.java:223)
> {noformat}
> This happens when I run the build on our Linux build server, but not always. I've been unable to make it fail in this manner on my computer and I'm therefore unable to debug it. I'm using INDIVIDUAL_ACKNOWLEDGE in my sessions.
> Searching around some of these keywords yields nothing helpful and I'm creating this issue in hopes to solicit your help.
> Line 413 is included in the following code where the cast occurs:
> {code:java}
> if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V4, getServerVersion())) {
> Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V4);
> SessionBindingQueryResponseMessage_V4 response = (SessionBindingQueryResponseMessage_V4) packet;
> return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), response.isAutoCreateAddresses(), response.isDefaultPurgeOnNoConsumers(), response.getDefaultMaxConsumers(), response.isDefaultExclusive(), response.isDefaultLastValue(), response.getDefaultLastValueKey(), response.isDefaultNonDestructive(), response.getDefaultConsumersBeforeDispatch(), response.getDefaultDelayBeforeDispatch());
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)