On Wed, Jul 15, 2009 at 3:43 AM, Michael Wood<esiot...@gmail.com> wrote:
>
> 2009/7/14 Stuart Halloway <stuart.hallo...@gmail.com>:
>>
>> ...wants your   help to be born! :-)
>>
>> There is a branch in clojure-contrib that includes work so far: 
>> http://github.com/richhickey/clojure-contrib/tree/jmx
>> . I want feedback on ease of use, most important features to add next,
>> code quality, you name it.
>>
>> Here's a teaser:
>
> I like it :)
>
> It doesn't seem to work with Clojure 1.0:
>
> user=> (require '[clojure.contrib.jmx :as jmx])
> java.io.FileNotFoundException: Could not locate
> clojure/stacktrace__init.class or clojure/stacktrace.clj on classpath:
>  (jmx.clj:0)
>
> But seems to work fine in the latest snapshot (at least for the local stuff).
>
> I've never tried this sort of thing before, but I'm trying to connect
> to a JBoss instance with it and not having much luck.  I think I need
> to authenticate somehow, but I have no idea how to do that.  Normally
> you look at these settings through a web interface, so I'm not quite
> sure what's necessary to bypass the web interface.
>

The usual way you can interact with JMX (if there's not dedicated
webconsole running) is either via JConsole (part of the JDK since
1.4.2 IIRC), or VisualVM (part of the Sun and derived (incl. OS X) JDK
since 1.6). jconsole is usually on the PATH, so you should be able to
launch it with 'jconsole' using whatever JDK is configured on the
PATH. I VisualVM is a bit more featureful and flexible and you should
be able to invoke it with 'jvisualvm' on the console, or from wherever
you downloaded a newer version to [1].

If you can connect with either of these tools, then it should be
possible to connect programmatically as well. Beware though that both
these tools have the possibility to connect to applications running on
the same machine through a special domain socket only available in
internal Sun classes (to be able to connect via JMX even if the
original process didn't enable JMX). To enable JMX the 'official' way,
follow the instructions at [2] (or [3] for the JBoss specific
incarnation of if).

Hope that helps

Cheers,
Daniel

[1] https://visualvm.dev.java.net/
[2] http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
[3] http://www.jboss.org/community/wiki/UseJDK5JConsole

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to