1 2 Previous Next 20 Replies Latest reply on May 17, 2010 3:57 AM by Jeff Mesnil

    Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage

    Jim Johnson Newbie

      I'm working on replacing Jboss Messaging with HornetQ in JBoss 4.2.3.GA.  Using the example straight out of the documentation (Chapter 30 section 4):

       

      {code}

         Queue managementQueue = HornetQJMSClient.createQueue("hornetq.management");
         QueueSession session = ...      
         QueueRequestor requestor = new QueueRequestor(session, managementQueue);
         connection.start();
         Message message = session.createMessage();
         JMSManagementHelper.putAttribute(message, "jms.queue.exampleQueue", "messageCount");
         Message reply = requestor.request(message);
         int count = (Integer)JMSManagementHelper.getResult(reply);
         System.out.println("There are " + count + " messages in exampleQueue");
      {code}

       

      I am creatting the Session via EJB injection of a connection factory, which creates a connection, which creates a session.  All standard JMS.

       

      The getResult() call is throwing the exception:

       

      {code}

      Caused by: java.lang.IllegalArgumentException: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
              at org.hornetq.api.jms.management.JMSManagementHelper.getCoreMessage(JMSManagementHelper.java:43)
              at org.hornetq.api.jms.management.JMSManagementHelper.getResult(JMSManagementHelper.java:172)

      {code}

       

      Anyone have any insights as to why this is/how to fix it?  Thanks.

        1 2 Previous Next