From 81b9a08d55564795cfc05fc8b7ce2cc74e3623fe Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Sun, 2 Jul 2006 16:50:19 +0000 Subject: [PATCH] http://issues.apache.org/activemq/browse/AMQ-665 git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/branches/activemq-4.0@418619 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/broker/jmx/OpenTypeSupport.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java index d6ee6ba47e..84a19a331b 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java @@ -145,7 +145,15 @@ public class OpenTypeSupport { try { byte preview[] = new byte[ (int)Math.min(length, 255) ]; m.readBytes(preview); - rc.put("BodyPreview", preview); + + // This is whack! Java 1.5 JMX spec does not support primitive arrays! + // In 1.6 it seems it is supported.. but until then... + Byte data[] = new Byte[ preview.length ]; + for (int i = 0; i < data.length; i++) { + data[i] = new Byte(preview[i]); + } + + rc.put("BodyPreview", data); } catch (JMSException e) { rc.put("BodyPreview", new byte[]{}); }