[ https://issues.apache.org/jira/browse/AMQ-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14173791#comment-14173791 ]
Timothy Bish commented on AMQ-5397: ----------------------------------- You might want to try out the 5.11-SNAPSHOT builds and see if the problem is still there. If so it would be great if you could create a test case for this, possibly add one to MQTTAuthTest.java in the activemq-mqtt project. > Using authorization plugin with MQTT causes ClassCastException on client > reconnect. > ------------------------------------------------------------------------------------ > > Key: AMQ-5397 > URL: https://issues.apache.org/jira/browse/AMQ-5397 > Project: ActiveMQ > Issue Type: Bug > Components: Connector, MQTT > Affects Versions: 5.10.0 > Reporter: Christian Tytgat > Priority: Critical > > We have the following setup: > MQTT client (reproducible with at least mosquitto and fusesource) with > cleanSession = false and QOS = 1 (important!) > AMQ with authentication/authorization plugin > {noformat} > <plugins> > <statisticsBrokerPlugin/> > <simpleAuthenticationPlugin> > <users> > <authenticationUser username="${activemq.username}" > password="${activemq.password}" groups="admins,everyone"/> > <authenticationUser username="mcollective" password="secret" > groups="mcollective,admins,everyone"/> > </users> > </simpleAuthenticationPlugin> > <authorizationPlugin> > <map> > <authorizationMap> > <authorizationEntries> > <authorizationEntry queue=">" write="admins" read="admins" > admin="admins" /> > <authorizationEntry topic=">" write="admins" read="admins" > admin="admins" /> > <authorizationEntry topic="mcollective.>" > write="mcollective" read="mcollective" admin="mcollective" /> > <authorizationEntry queue="mcollective.>" > write="mcollective" read="mcollective" admin="mcollective" /> > <authorizationEntry topic="ActiveMQ.Advisory.>" > read="everyone" write="everyone" admin="everyone"/> > </authorizationEntries> > </authorizationMap> > </map> > </authorizationPlugin> > </plugins> > {noformat} > No problem to connect for the first time, but when reconnecting with the same > client ID, the connection fails each time: > {noformat} > 2014-10-16 11:20:41,120 [MQ NIO Worker 3] WARN Transport - Transport > Connection to: tcp://10.0.2.2:49479 failed: > org.apache.activemq.transport.mqtt.MQTTProtocolException: Error recovering > retained messages for m2mbox.macbookx.schedule: > org.apache.activemq.security.AuthorizationDestinationFilter cannot be cast to > org.apache.activemq.broker.region.Topic > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)