New to JMX

What good JMX books can anyone rec?
Also, I am trying to get something setup on linux using jconsole. Do i have to have a running program to connect to first?
Does it already have to be started, implementing the JMX interface and all?
Also, reading some docs, it says I have to start the jvm using -Dcom.sun,.management.etc....
Basically, does this mean run your application with these options like:
java -Dcom.sun.management.jmxremote.authenticate=false ,yes,no?
I'm using jdk jre 1.5
Currently w the jconsole I get 'cannot connect' or 'no route to host', but I have not any JMX code on the server yet.
Just checking if I'm headed in the right direction.

The most significant problem with JMX books is their [relatively old age|http://marxsoftware.blogspot.com/2008/01/outdated-jmx-books.html]. While the most basic fundamentals of JMX are still the same, there have been many significant enhancements in the JMX world since most of these books were published. Remote JMX may the most obvious and glaring deficiency in most of these books. As an example, most of these books use the HTML Adaptor that is now part of OpenDMK as their means for showing client-side views of managed resources. Today, however, the obvious choice would be JConsole or even VisualVM now. When you throw in useful additions such as MXBean, the [JMX Web Services Connector|http://marxsoftware.blogspot.com/2008/05/first-look-at-jmx-web-services.html], and new tools that make working with JMX easier, online resources seem to have many advantages. Even [JMX fundamentals|http://blogs.sun.com/jmxetc/entry/looking_for_jmx_overview_examples] are covered well [online in resources|http://marxsoftware.blogspot.com/2008/03/online-jmx-resources.html] such as the [JMX section|http://java.sun.com/docs/books/tutorial/jmx/index.html] of the [Java Tutorial|http://java.sun.com/docs/books/tutorial/] , [blog entries|http://blogs.sun.com/jmxetc/entry/what_is_jmx], and so forth. While the books are generally outdated, they are still largely relevant for the fundamentals and can often be acquired cheaply, especially if purchased used. Of the books I have spent significant time with, I prefer the [O'Reilly JMX book|http://oreilly.com/catalog/9780596002459/] and the [JMX in Action|http://www.manning.com/sullins/] book.
You do need an instrumented Java application running for JConsole to connect to. In Sun's implementation of J2SE 6, this is essentially any Java application you run thanks to the Attach API. You may not see much about a particular application, but you will see information on the JVM even when a particular application is not explicitly instrumented for JMX management. With J2SE 5, you did need to specify via system property (*-Dcom.sun.management.jmxremote*) on the command-line when you ran a particular Java application that you wanted it exposed for JConsole or other JMX client management. This is described in detail in [Using JConsole to Monitor Applications|http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html].
If you want to run without authentication/authorization concerns (usually the case when beginning JMX work), you can specify the following options in J2SE 5.
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=XXXX
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
For example, you could run an application called mypackage.myclass in MyApp.jar and have it fully exposed to remote clients via port 6666 like this:
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6666 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false  -cp MyApp.jar mypackage.myclass(or you might not run a class out of a JAR and might provide the classpath as directories and/or multiple JARs).
See [Monitoring Local and Remote Applications Using JMX 1.2 and JConsole|http://www.onjava.com/pub/a/onjava/2004/09/29/tigerjmx.html] for additional details.
Eventually, you'd probably like to start actually securing the exposed management of the application and can do so by playing with the appropriate system properties.

Similar Messages

  • New to JMX and JConsole usage

    I am just learning about the app montoring features available through JConsole. I am using jdk150_06 to montor an app locally on a Windows PC. I set the property (-Dcom.sun.management.jmxremote) on the statup of my app. The JConsole comes up, sees the JVM, I connect to it and everything seems ok. I want to pull a heap dump of the app to look at in the Memory Analyzer plugin tool available in Eclipse 3.5. According to all the doco I see in JConsole I should see a "com.sun.management" MBean registered in which I can specify a location for the heap dump and generate one. However, I don't see a "com.sun.management" MBean in my JConsole.
    Wondering if anyone has done this before? Am I looking for the wrong thing? Is it maybe my JDK version or something?
    Any help is appreciated.
    Thanks,
    Troy

    Hi Rishabh
    Instructions for enabling jmx on a per-StorageNode basis can be found in chapter 8 of the Admin Guide: http://docs.oracle.com/cd/NOSQL/html/AdminGuide/standardized-monitoring.html
    You can enable JMX when you create the bootstrap configuration, or after the store has been deployed by setting the StorageNode's mgmtClass parameter.
    Once you have enabled it, you can connect to the JMX service by way of the StorageNode's registry. In Jconsole's "New Connection" dialogue, select "Remote Process" and supply the registry's hostname:port, where port is the number that was given as the -port argument in the makebootconfig command that originally configured the StorageNode.
    The MBeans are described in the javadoc for oracle.kv.mgmt.jmx at http://docs.oracle.com/cd/NOSQL/html/javadoc/oracle/kv/mgmt/jmx/package-summary.html.
    -- Guy

  • How to connect resin server from jmx code

    Hi All,
    I am new in JMX and also Resin Server...
    I am writing following code to connect to resin server for getting information about resin server like thread, session etc...
    import java.io.IOException;
    import java.lang.management.ManagementFactory;
    import java.net.MalformedURLException;
    import javax.management.AttributeNotFoundException;
    import javax.management.InstanceNotFoundException;
    import javax.management.MBeanException;
    import javax.management.MBeanServer;
    import javax.management.MBeanServerConnection;
    import javax.management.MBeanServerDelegate;
    import javax.management.ReflectionException;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServiceURL;
    public class ResinConnection {
         private static MBeanServerConnection server;
         private final static String hostname = "localhost";
         private final static Integer port = 8080;
         public static void main(String[] args) {
              //Get the platform MBeanServer
              MBeanServer mbeanserver = ManagementFactory.getPlatformMBeanServer();     
              // Create an RMI connector client and connect it to
    // the RMI connector server
         System.out.println("Connecting to " + hostname + ":" + port);
         String urlPath = "/jndi/rmi://" + hostname + ":" + port + "/jmxrmi";
    MBeanServerConnection server = null;
    try {
    JMXServiceURL url = new JMXServiceURL("rmi", "", 0, urlPath);
    JMXConnector jmxc = JMXConnectorFactory.connect(url);
    System.out.println("Connection Established.........");
    server = jmxc.getMBeanServerConnection();
    } catch (MalformedURLException e) {
    // should not reach here
         System.out.println("Error in connection"+e.getMessage());
    } catch (IOException e) {
    System.err.println("\nCommunication error: " + e.getMessage());
    System.exit(1);
    try{
              String implName = (String) mbeanserver.getAttribute(MBeanServerDelegate.DELEGATE_NAME,"ImplementationName");
                   System.out.println("JMX Implementation Name = " + implName );
                   String defaultDomain = (String)mbeanserver.getDefaultDomain();
                   System.out.println("Deafult Domain : "+ defaultDomain);
                   Integer count = server.getMBeanCount();
                   System.out.println(count);
    }catch(MBeanException ex){
         System.out.println("Error in Mbean : "+ex.getMessage());
    catch(ReflectionException ex){
         System.out.println("Error in Reflection : "+ex.getMessage());
    catch(InstanceNotFoundException ex){
         System.out.println("Error in Instance : "+ex.getMessage());
    catch(AttributeNotFoundException ex){
         System.out.println("Error in Attribute : "+ex.getMessage());
    catch(IOException ex){
         System.out.println("Error in Input/Output : "+ex.getMessage());
    Follwing Exception
    Connecting to localhost:8080
    Communication error: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
         java.net.SocketTimeoutException: Read timed out]
    Could anyone suggest to me .....

    default resin JMX port is 9999.

  • Running JMX with HTML adapter

    Hi!
    I am new to JMX MBeans and I'm trying to run a simple sample program with HtmlAdaptorServer. I have three .java files, one with the interface, on with the class having its implementation and a main .java file to register with the server..etc.
    I am able to compile the 3 files without any error but while running, it gives me the following exeption:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    HelloAgent (wrong name:com/example/mbeans/HelloAgent)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    Can someone please help me as to where am I goin wrong?
    -Kanak

    Kanak10 wrote:
    hi!
    I have the same, a com, then example, mbean and inside it HelloAgent.java.That's not what I've been describing. Almost, but not entirely. Check what I wrote above.
    But how do I exactly set the classpath? should it be an environment variable?Sorry, but if you don't know that, then you must keep away from JMX for some time and go back to the basics.
    See this and this.

  • JMX, Firewall and javaagent option

    Hey all,
    I'm working on setting up JMX monitoring on the JVMs running in our environment. Most of those JVMs are running third party applications supplied by our customers and are heavily protected by firewalls. So i needed to use the JavaAgent strategy to be able to set a fixed port for the JMX agent. (see: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html)
    This all works very nice except that the JVM will never exit. The RMI Reaper is a non-daemon thread and will have to be stopped manually before the JVM will shutdown. The application has no knowledge of the RMI Reaper (as it is started from the premain method). A ShutdownHook doesn't work because those are called after the JVM decided to shutdown or when an external event is triggered (Ctrl-C) for example.
    For now i have this horrible workaround. I create a thread that checks if there is still a main thread in the JVM. If there isn't it shuts down the JMX server and that allows the JVM to close down. Is there a better way of doing this? below is the code:
    public class JMXAgent {
        private static JMXConnectorServer cs;
        private static Logger logger;
        public static void premain(String agentArgs, Instrumentation inst) {
               /** snip */
               JMXServiceURL url =
                        new JMXServiceURL("service:jmx:rmi://0.0.0.0:" + RMIConnectorPort + "/jndi/rmi://:" + RMIRegistryPort + "/jmxrmi");
                cs = JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
            // Setup the failsafe
            Thread failsafeThread = new MainCheckerThread();
            failsafeThread.start();
            logger.fine("MainChecker Thread created.");
            // Setup the shutdown hook
            Thread shutdownThread = new ShutdownThread();
            Runtime.getRuntime().addShutdownHook(shutdownThread);
            logger.fine("SchutdownHook implemented.");
        public static void stop() {
            try {
                logger.info("Stop called");
                cs.stop();
            } catch (IOException ex) {
                ex.printStackTrace();
         * Shutdown thread that allows the tracer to write out any final
         * information.
        private static class ShutdownThread extends Thread {
            @Override
            public void run() {
                JMXAgent.stop();
                Runtime.getRuntime().halt(0);
        private static class MainCheckerThread extends Thread {
            @Override
            public void run() {
                boolean found = true;
                while (found) {
                    Logger.getLogger(this.getClass().getName()).finest("Ping!");
                    ThreadGroup root = Thread.currentThread().getThreadGroup();
                    while (root.getParent() != null) {
                        root = root.getParent();
                    Thread[] list = new Thread[400];
                    int threads = root.enumerate(list, true);
                    found = false;
                    for (int i=0; i<threads; i++) {
                        if (!list.isDaemon()) {
    if (list[i].getName().equals("main")) {
    found = true;
    if (!found) {
    /** No main found, stop the RMI server */
    JMXAgent.stop();
    } else {
    try {
    Thread.sleep(10000);
    } catch (InterruptedException ex) {
    JMXAgent.stop();
    found=false;

    Hi Hugo,
    This is a very interesting question.
    What happens here is that the RMI object exported by the JMX connector server prevents
    the RMIReaper thread from terminating: as long as the JMX connector server is active, its
    exported RMIServer object will remain active, and the RMI Reaper thread will stay there
    waiting for the RMIServer object to be unexported.
    This is in fact a feature: JMX connector servers where designed to be controlled by
    the application itself. In the usual way of using JMX Connector Server, you would start your
    server in main() (or some application equivalent of main) and stop it later on before exiting
    your application.
    Things got a little more complex when we introduced the 'out-of-the-box management'.
    In the 'out-of-the-box management' the default connector is not controlled by the application
    but by the VM - or more exactly by an agent loaded in the VM. As you rightly noticed, the
    agent has no idea as to when the application (the main) will exit.
    The default 'out-of-the-box management' agent is thus conspiring with RMI (using sun
    private APIs) to export its RMIServer object, so that its exported RMIServer doesn't
    prevent the RMI Reaper thread to terminate. These APIs are unfortunately private and
    non portables (and low-level).
    Maybe we should think of supporting some kind of 'daemon connector servers' for the future.
    The ability of starting JMX Connectors servers in premain agents obviously makes this desirable.
    Concerning your 'hack' that detects the end of the main thread I will make two observations:
    1) such a hack might work if indeed the application is expected to exit when the main thread
    terminates. This is not always the case - for instance consider this:
        public void main(String[] args) {
               final Thread myMainThread = new Thread("My real main thread") {
                     public void run() {
                            try {
                                  System.out.println("Strike <return> to exit: ");
                                  System.in.read();
                            } catch(Exception x) {
                                  x.printStackTrace();
                 myMainThread.start();
          }Such an application will wait for the user to strike enter to exit, although the main thread is
    already terminated and gone. So the termination of main thread doesn't necessarily means
    that the application is finished.
    2) The concept of detecting a main thread is tenuous. What happens if an application does
    new Thread("main") ?
    This being said - detecting the absence of "main" thread might be sufficient to your needs in
    most of the case. If you simply call JMXConnectorServer.stop() when you detect that the
    main thread is no longer there - the only risk you will be taking is stopping the
    JMXConnectorServer ahead of time, before the application actually exits. If you want
    to implement such a hack - you might wish to use the following logic:
        // Attempts to find a "main" thread
        public static Thread findmain() {
            // When the premain agent is loaded from the command line the
            // current thread is the main thread....
            final Thread current = Thread.currentThread();
            if (current.getName().equals("main")) return current;
            // If the premain agent was loaded from the attach API, or by some
            // other means, the current thread might not be the main thread.
            // Try to find a main thread using Thread.enumerate()
            // The main thread should be already there, allocate some
            // more space than needed just to be sure we do get it, even if
            // new threads are created in between.
            final Thread[] all = new Thread[Thread.activeCount()+100];
            final int count = Thread.enumerate(all);
            // Try to find the main thread
            for (int i=0;i<count;i++) {
                if (all.getName().equals("main")) return all[i];
    return null;
    public static void premain(String agentArgs)
    throws IOException {
    final JMXConnectorServer cs = .....
    cs.start();
    final Thread main = findmain();
    final Thread clean = new Thread("JMX Agent Cleaner") {
    public void run() {
    try {
    if (main != null) main.join();
    System.out.println("main thread exited...");
    } catch (Exception x) {
    x.printStackTrace();
    } finally {
    try {
    System.out.println("cleaning up JMX agent...");
    cs.stop();
    } catch (Exception x) {
    x.printStackTrace();
    clean.setDaemon(true);
    clean.start();
    If you really want your JMXConnectorServer to stop() at the latest possible time, you could
    for instance modify this logic to find the first non daemon thread (excluding RMI Reaper and
    DestroyJavaVM threads), join it, and loop over this until the only non daemon thread that
    remains is/are the RMI Reaper threads, in which case you would close the
    JMXConnectorServer.
    This would not be completely foolproof either because the normal behavior of the application
    could precisely be to be held alive by an exported object, and waiting on some
    external communication to stop. So even counting the non-daemon thread until only
    the RMI Reaper threads remain doesn't necessarily means that the application is
    finished...
    Here is an example of CleanThread class that implements the logic above:
    public class JMXAgent {
        public static class CleanThread extends Thread {
            private final JMXConnectorServer cs;
            public CleanThread(JMXConnectorServer cs) {
                super("JMX Agent Cleaner");
                this.cs = cs;
                setDaemon(true);
            public void run() {
                boolean loop = true;
                try {
                    while (loop) {
                        final Thread[] all = new Thread[Thread.activeCount()+100];
                        final int count = Thread.enumerate(all);
                        loop = false;
                        for (int i=0;i<count;i++) {
                            final Thread t = all;
    // daemon: skip it.
    if (t.isDaemon()) continue;
    // RMI Reaper: skip it.
    if (t.getName().startsWith("RMI Reaper")) continue;
    if (t.getName().startsWith("DestroyJavaVM")) continue;
    // Non daemon, non RMI Reaper: join it, break the for
    // loop, continue in the while loop (loop=true)
    loop = true;
    try {
    System.out.println("Waiting on "+t.getName()+
    " [id="+t.getId()+"]");
    t.join();
    } catch (Exception ex) {
    ex.printStackTrace();
    break;
    // We went through a whole for-loop without finding any thread
    // to join. We can close cs.
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    try {
    // if we reach here it means the only non-daemon threads
    // that remain are reaper threads - or that we got an
    // unexpected exception/error.
    cs.stop();
    } catch (Exception ex) {
    ex.printStackTrace();
    public static void premain(String agentArgs)
    throws IOException {
    final JMXConnectorServer cs = .....
    cs.start();
    final Thread clean = new CleanThread(cs);
    clean.start();
    Thanks for bringing this to my attention! I'm probably going to have to update my entry
    on this subject at
    http://blogs.sun.com/jmxetc/entry/connecting_through_firewall_using_jmx
    Hope this helps,
    -- daniel
    http://blogs.sun.com/jmxetc

  • Using JMX

    This is not nessacerly for j2ee itself but since it's enterprise type stuff...
    I have this requirment where I need to create a central configuration/mangement system for my broker applications.
    My applications bassically, receive data and forward it to 3rd parties and vise versa.
    Now one idea was to store all config values etc... in the db. But then it would require writitng a whole bunch of code to access thevalues from the database etc...
    Though I new about JMX I never really payed attention to it...
    So If I understand JMX correctly... I could write my application in the following way...
    At start up, read a java properties file.
    Implement get/set methods and application management functions in my application.
    Then implement mbeams that use those get/set methods.
    The get part is quite easy cause the getter methods would just return the current value of "propertie" in question.
    I figure using the java properties api I would be able to persist the changed propertie everytime I call a set method.
    Now the other issue is if I want to cluster the application propertie files are a no no since I would have to share the config values bewteen the nodes... How would I go about it?
    Thanks

    With J2EE, this can be done easily with an entity bean and container managed persistence. For a good example, see the PlayerBean example in the J2EE 1.4 tutorial, Chapter 27 Container-Managed Persistence Examples.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
    regards,
    Hans

  • Role of Interceptors in JMX?

    Hi I am new to JMX I dont understand what are mbeans and how JBOSS keeps track of Transactions ? and how do the interceptors work in Jboss. Could someone gve me an insight into the the JMX architecture and then probably suggest me a document.

    tp = transports and puts...is one of the main programs on operating system level which does the actual transport...
    login to the operating system using user <sid>adm and call tp help - this will give you a good overview
    -> written codes? what do you mean by that?
    GreetZ, AH

  • How to expose JMX MBeans To Remote Clients ?

    Hi all,
    New to JMX...need some configuration guidance :)
    I'm trying to add a new JMX service - the will invoke an already existing service on my application...but I can't find a good example for exposing JMX MBeans to remote clients...
    I found this page http://wiki.jboss.org/wiki/en/JMXMBeanRemoteProxy?action=e&windowstate=normal&mode=view (fairly old...) but I'm not sure how to "create a proxy for the MBean and bind it under MyServiceInvokeTarget? JNDI name"
    Where can I find a good example for exposing app interface to JBoss JMX ?
    Thanks,
    Hadas
    Edited by: Hadas-David on May 28, 2008 7:36 AM

    I don't use JBoss, but because you have not received a reply yet, I'll throw some possible references out. You might try [Section 2.7|http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch2.chapter.html#ch2.remoteaccess.sect] ("Remote Access to Services, Detached Invokers") of the [JBoss 4 Application Server Guide|http://docs.jboss.org/jbossas/jboss4guide/r5/html/] (PDF) to get more information. I listed some additional references that a JBoss developer might want to check out in [another entry in this same forum|http://forum.java.sun.com/thread.jspa?threadID=5295861&tstart=0] as well as [still another entry in this forum|http://forum.java.sun.com/thread.jspa?threadID=5298128&tstart=0]. The [JBoss Wiki|http://wiki.jboss.org/wiki/] entry [JMX_Remoting_service_configuration|http://wiki.jboss.org/wiki/JMX_Remoting_service_configuration] looks like a potentially useful resource for using JMX on JBoss. Another entry on that same Wiki (JBossMX) states "JBoss MX supports version 1.2 of the JMX specification (JSR 003) since JBoss versions 3.2.5 and 4.0.0. *Support for the JMX Remote API (JSR 160) is under development*" (I added the bold emphasis). This last entry links to another entry ([Using the RMI Adaptor|http://wiki.jboss.org/wiki/UsingTheRMIAdaptor]) that might be exactly what you need.

  • JMX newbie question: isn't jmx just a private case of remoting / rmi ?

    I'm new to jmx, so I hope this question doesn't sound too weird....
    I've been looking into JMX, and were wondering:
    It seems like the entire JMX framework is about exposing management methods to remote clients (or local ones)...
    But if so, why not use any other (generic) remoting mechanisms, such as RMI or web services ?
    ( I mean, a management method is just a method - why can't it be exposed using the same mechanism as business methods ?)
    I did notice that JMX offers more flexibility in terms of protocol (adapters / connectors)... but then I thought, well, if they throught it's worth it to have pluggable protocols for remote *management", why didn't they do the same thing for RMI - have pluggable interfaces for it , too ?
    Thanks !

    I'me new to jmx too...
    I think that JMX is a Management framework...
    not such as RMI or web wervices..
    even if you are working in the biggest project...
    when you use JMX framework,it can help to control your project...
    Just I think...

  • Polling JMX monitor

    I'm looking for a tool that can pull data from an RMI JMX connection and use it for generating alerts and storing historical JMX attributes. I've seen many solutions that want to "push" the data via a Java agent to their monitoring servers but I haven't seen many that try to pull data.
    Any ideas of some good products out there?

    Hi,
    The short answer is yes to all your questions.
    The longer answer is that you should be careful when using custom types
    in your MBeans, because 1) you will need to make them serializable, and
    take care of compatibility issues when they evolve, and 2) you will need to
    make the jar that contain them available on the manager side.
    To overcome this, JMX defines the notion of Open MBeans and OpenTypes, that
    is, generic data-types (CompositeData and TabularData) that can be used to
    model custom types.
    In JDK 6, we're also introducing the notion of MXBean (see the excellent article
    on http://java.sun.com/developer/technicalArticles/J2SE/mxbeans/ ).
    MXBeans are just like MBeans, except that the MBeanServer will automatically
    transform your custom types into OpenTypes (not all custom types can be
    automatically converted - but a great many of them).
    In JDK 6 build 98 you will find a new advanced JMX example that demonstrate
    configuration MXBeans using XML serializable beans as MBean attributes.
    Concerning Notifications, the same concerns applies. We usually recommend
    not to create any custom subclass of notification, but use one of the standard
    base classes instead. A JMX notification has a user data field in which you
    could embed an instance of a generic Open Type (CompositeData/TabularData)
    if needed.
    The new advanced JMX example also show how you can 'reuse' the base
    notification classes.
    See:
    http://blogs.sun.com/jmxetc/entry/looking_for_jmx_overview_examples
    for JMX tutorial, examples, etc...
    and
    http://blogs.sun.com/jmxetc/entry/an_advanced_jmx_example_for
    for instruction on the new JDK 6 JMX example.
    I hope this will get you started on JMX!
    -- daniel
    JMX, SNMP, Java, etc
    http://blogs.sun.com/jmxetc

  • When should I use JMX

    Hi all
    I am new to JMX and trying to understand the concepts here.
    I read what is JMX (manages/monitors the application)
    Today let say, I have already web based application. I already monitor and manage what I need. So why would I want JMX?
    If using JMX , I can manage and monitor, then why would I need my web based app?
    I appriciate if some one explains me this.
    thanks

    Hi,
    You may be interested in these three articles:
    "What is JMX":
    http://blogs.sun.com/jmxetc/entry/what_is_jmx
    "Easy Is Not Always Simple":
    http://blogs.sun.com/jmxetc/entry/easy_is_not_always_simple
    Also the excellent article by Brian Goetz:
    "Java theory and practice: Instrumenting applications with JMX"
    http://www-128.ibm.com/developerworks/java/library/j-jtp09196/index.html
    I believe they will answer your questions.
    Best regards,
    -- daniel
    JMX, SNMP, Java, etc...
    http://blogs.sun.com/jmxetc

  • Monitor my jsp-servlet application through the jmx

    heloo,
    i am new in JMX. and i want to manage(or monitor) my jsp-servlet application. there lots of
    servlets and jsp files. its is running in tomcat. i made simple demo application which
    is given by oracle tutorial. but it is just for one interface and its implementations so how
    can i monitor my whole jsp-servlet application by JMX.
    i want to Monitor three things
    Memory
    JVM
    Thread
    Thanks...

    Hi,
    I fixed my problem by setting the system wide variable (WindowsXP)
    CLASSPATH to r:\\dealershop\\WEB-INF\\classes.
    Thanks,
    Andrea
    andrea costantinis wrote:
    Hi,
    I developed a JSP/servlet test application that makes
    use of kodo 2.2.3 STANDARD EDITION for its persitence.
    I successfully compile and annotate the application.
    I am also able to successfully generate the db
    schema with schematool.
    Unfortunately, when I run the application using
    Resin 2.0.2, Kodo is unable to initialize properly.
    Initially it was not able to find \"system.prefs\" file.
    I fixed that by putting \"system.prefs\" in WEB-INF\\classes.
    Unfortunately, Kodo is still unable to initialize and
    gives the following message:
    The system could not initialize; the following registered
    persistent types are missing metadata
    or have not been enhanced:
    [class com.dpov.purchaseorder.PurchaseOrder,
    class com.dpov.catalog.Product,
    class com.dpov.uidgen.counter.Counter,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyEntry,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyDAO,
    class com.dpov.pricelist.PriceInfo,
    class com.dpov.pricelist.PriceList,
    class com.dpov.catalog.Category,
    class com.dpov.lineitem.LineItem,
    class com.dpov.dealer.Dealer,
    class com.dpov.user.User,
    class com.dpov.customer.Customer].
    I use \"system.jdo\" to describe metadata for the enhancer.
    I tried to put it both in WEB-INF\\lib and WEB-INF\\classes but
    it still fails.
    Please note that:
    1) my classpath variable is not set
    2) my application\'s class file are in WEB-INF\\classes
    3) kodo jars are in WEB-INF\\lib
    4) mysql jdbc driver is in WEB-INF\\lib
    5) system.prefs is in WEB-INF\\classes
    6) system.jdo is in WEB-INF\\classes
    Thanks in advance,
    Andrea

  • JMX: could you please recommend free HTML adaptors ?

    Hi,
    I'm new to jmx and would appreciate help on the following:
    Is it true that JDK 1.5 comes without the old HTML adpator which was in 1.4 .
    And if so - could anyone please recommend some free html adaptors ?
    (it would be even better if such adapter happends to support SSL).
    Thankx

    Thank you, but I already knew of that list. I was hoping that someone who's tried those could recommend one, since it takes quite a while for me to install a program, learn to use it and realize it wasn't what I needed. (Already tried a few of those on the list.)
    Message was edited by:
    Kryigerof
    Message was edited by:
    Kryigerof

  • JMX Notification

    Hi,
    I am new to JMX,
    I have written sample code after looking at the examples provided in CodeShare...
    The requirement in my project is .. We need to recieve notifications from Weblogic MBeans like JDBCConnectionPoolRuntime, JVMRuntime etc,
    I am able to add a NotificationListener to the above MBeans, but i am not able to get any notifications from the Listener.. even there is change in the attibutes of above MBeans.
    I tried an example which registers to LogBroadcasterRuntime but the example code also did not throw any notifications.
    Please help me out ..
    Thanks and Regards,
    Keerthi

    ( I have another thought using JMX notifications with spring 2.0. The easiest way to send notifications is to inherit from NotificationBroadcasterSupport, however trouble arises when inheritance is already in use.
    Is there a nice way to avoid implementing addNotificationLister, removeNotificationListener and sendNotification which are part of the otificationBroadcaster ? )
    ......and at the expense of coupling to both spring and jmx the notificationPublisher is an excellent tool to satisfy my demands .........
    Message was edited by:
    Toxic
    Message was edited by:
    Toxic

  • Simple JMX Example

    Hi All,
    I am new to JMX and after lot of surfing somehow able to understand the key features and usage of JMX.
    For an example everywhere i get the example of Hello World where, method is invoked using the jconsole.
    Does anyone can provide me the way by which or the link to an example in which i can setup my jmx enviornment and invoke the method just using the java code. I would like to use MX4J api.
    Any suggestions and guidence would be great.
    thnaks

    Hi,
    I have written an example that shows how to retrieve the JVM Management & Monitoring
    information (the data exposed by the java.lang.management MXBeans) programmatically:
    see here:
    http://blogs.sun.com/jmxetc/entry/how_to_retrieve_remote_jvm
    Note that this example also shows how to use the Attach API (connecting to the
    process ID) - which is not the regular way to connect to a JMX agent.
    Using the attach API works only when the client application
    is started by the same user who started the server, and runs on the same machine
    than the server.
    The regular way is to start the agent with a port#, and then use a JMXServiceURL
    as input on the client side .
    Assuming you have registered your own MBeans in the platform MBeanServer you
    will be able to retrieve the data they expose using the same techniques.
    Monitoring the count of connected users is a very valid scenario for using the JMX API.
    Best regards,
    -- daniel
    http://blogs.sun.com/jmxetc

Maybe you are looking for