MBeans will let you store serialized java objects, so you can also find hashmaps, or arbitrary arrays. When you encounter cases like this one, you can extend clojure.data.json's functionnality to get the appropriate behavior (see http://spootnik.org/blog/2011/08/12/a-bit-of-protocol/ for hints)
On Thu, Feb 23, 2012 at 2:47 AM, zoka <ztomi...@gmail.com> wrote: > I was trying to convert result of JMX attributes query to JSON, and > encountered problem while reading one particular attribute value of > java.lang:type=Threading. Here is the REPL transcript: > > demo.server=> (require '[clojure.java.jmx :as jmx]) > nil > demo.server=> (jmx/read "java.lang:type=Threading" :AllThreadIds) > #<long[] [J@1bd97d0d> > demo.server=> > > This seems to be Java long array reference, > > The jmx/mbean function that returns all attribute name as keywords > associated with their values carries this value through. Attempt to > convert such map to JSON string causes exception, since in this case > a clojure vector of longs would be expected instead of Java array. > > This particular piece information (list of application ThreadIs) is > not of particular interest to me anyway, so it is easy just to remove > the offending map entry as a workaround. > > I have noticed some recent activity in clojure.java.jmx github repo, > so I thought it would be appropriate to rise this issue, since it may > be affecting some other attributes as well. > > Regards > Zoka > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en