ClassCastException while importing messages from a hornetq-journal file.

Solution Verified - Updated -

Issue

When executing the HornetQ importer tool, the following exception is thrown. The problem is triggered by queues with ID > max Integer. These IDs cause the ClassCastExceptions.

Examples
queue id 2147483667 - ClassCastException
queue id 54 - Ok
queue id 2147483673 - ClassCastException
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
        at org.hornetq.jms.persistence.impl.journal.XmlDataImporter.sendMessage(XmlDataImporter.java:389)
        at org.hornetq.jms.persistence.impl.journal.XmlDataImporter.processMessage(XmlDataImporter.java:329)
        at org.hornetq.jms.persistence.impl.journal.XmlDataImporter.processXml(XmlDataImporter.java:225)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6.4.8
    • HornetQ Importer tool org.hornetq.jms.persistence.impl.journal.XmlDataImporter

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content