ActiveMQ
  1. ActiveMQ
  2. AMQ-3512

Using browse command fails when a message with an array of bytes is encountered.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5.0
    • Fix Version/s: 5.6.0
    • Component/s: Broker
    • Labels:
      None

      Description

      -bash-3.2$ /home/y/bin/activemq_server_admin browse --amqurl
      tcp://localhost:61616 VirtualTopicConsumers.ac4-stg-2.Soo_RMXReplicator_Primary

      ERROR: java.lang.RuntimeException: Failed to execute browse task. Reason: java.lang.reflect.InvocationTargetException
      java.lang.RuntimeException: Failed to execute browse task. Reason: java.lang.reflect.InvocationTargetException
      at org.apache.activemq.console.command.AmqBrowseCommand.runTask(AmqBrowseCommand.java:144)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
      at org.apache.activemq.console.Main.main(Main.java:107)
      at yjava.activemq.server.admin.ActiveMQAdmin.main(ActiveMQAdmin.java:39)
      ERROR: java.lang.Exception: java.lang.reflect.InvocationTargetException
      java.lang.Exception: java.lang.reflect.InvocationTargetException
      at org.apache.activemq.console.command.AmqBrowseCommand.runTask(AmqBrowseCommand.java:145)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:143)
      at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
      at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:85)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
      at org.apache.activemq.console.Main.main(Main.java:107)
      at yjava.activemq.server.admin.ActiveMQAdmin.main(ActiveMQAdmin.java:39)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.activemq.console.filter.MapTransformFilter.transformElement(MapTransformFilter.java:67)
      at org.apache.activemq.console.filter.ResultTransformFilter.transformList(ResultTransformFilter.java:67)
      at org.apache.activemq.console.filter.ResultTransformFilter.query(ResultTransformFilter.java:43)
      at org.apache.activemq.console.filter.PropertiesViewFilter.query(PropertiesViewFilter.java:58)
      at org.apache.activemq.console.filter.PropertiesViewFilter.query(PropertiesViewFilter.java:58)
      at org.apache.activemq.console.util.AmqMessagesUtil.filterMessagesView(AmqMessagesUtil.java:64)
      at org.apache.activemq.console.command.AmqBrowseCommand.runTask(AmqBrowseCommand.java:140)
      ... 11 more
      Caused by: java.lang.ClassCastException: [B cannot be cast to [Ljava.lang.Object;
      at org.apache.activemq.console.filter.MapTransformFilter.getDisplayString(MapTransformFilter.java:336)
      at org.apache.activemq.console.filter.MapTransformFilter.transformToMap(MapTransformFilter.java:213)
      ... 22 more
      -bash-3.2

      I'll attach a patch and a test case for getDisplayString shortly.

      1. AMQ_3512.patch
        3 kB
        Allen Reese

        Activity

        Hide
        Timothy Bish added a comment -

        patch applied, thanks, especially for also providing a unit test!

        Show
        Timothy Bish added a comment - patch applied, thanks, especially for also providing a unit test!
        Hide
        Allen Reese added a comment -

        Patch to fix MapTransformFilter.getDisplayString not handling primitive arrays or nulls.

        Show
        Allen Reese added a comment - Patch to fix MapTransformFilter.getDisplayString not handling primitive arrays or nulls.

          People

          • Assignee:
            Unassigned
            Reporter:
            Allen Reese
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development