Installation Instructions

  • The Components

    The following is a list of components used by JMX4ODP. They are all freely available on the web, and thus have not been included in the download, think of it as a scavenger hunt. Also, many of these packages are already included in most J2EE environments. If you are already running an EJB server like Jboss or a servlet engine like Tomcat, you probably already have all of these already setup and configured on your system.


    • Ant

      Ant is the Apache Java based make tool. It isn't strictly needed for JMX4ODP, as none of the libraries use it. However, JMX4ODP is set up with ANT build.xml files and uses Ant to auto-generate example start scripts. Plus ant is super easy to install.

      So I would really encourage you to download Ant and install it, if you already haven't. It will make your life a lot easier.


    • Sun JMX-RI

      The Sun JMX-RI is distributed as both source code and binary. It is available freely from Sun. It contains a complete JMX implementation and the RMI remoting tools used by JMX4ODP.


    • Xerces

      Xerces is the Apache XML project's XML parser. It is available for multiple languages including Java. It is the XML parser that many J2EE projects including Tomcat and Jboss have settled on. It is open source and freely available.


    • ejb.jar

      The ejb.jar contains the javax.ejb package which is used by JMX4ODP's dynamicManagement package to control EJB's. This is part of the J2EE package from Sun. If you have it, or any EJB server installed upon your system, you should already have these classes somewhere.


    • junit.jar

      The junit.jar contains the Junit testing suite. Junit is a popular open source package that is the de facto standard for constructing unit tests in the java world. This package is used by the JMX4ODP unit tests, and the diagnostic packages.


    • jndi.jar

      The jndi.jar contains the javax.naming package which is used by JMX4ODP to implement JNDI lookups, as well as by the Sun JMX-RI to implement part of the RMI protocol.
    • mail.jar

      The mail.jar contains the javax.mail package which is used by JMX4ODP's NotificationMailer object, which emails notifications received from JMX agents.


    • jmx4odp.zip

      JMX4ODP is the actual JMX4ODP package. Download this from sourceforge, unless you are reading the copy of the manual that comes in the package-then you already have it :-).


  • Installing the Files

    1. Install ant and make sure that ant is in your execution path.


    2. Expand jmx4odp.zip

      Take the jmxodp.zip file and unzip it into the directory of your choice. You will end up with several subdirectories including: src, classes, and manual.


    3. Add the jmx4odp/classes directory to your Java CLASSPATH.


    4. Locate the following jar files:
      • Sun JMX-RI: jmxri.jar, jmxtools.jar, and jmx_remoting.jar
      • Xerces: xerces.jar
      • J2EE: ejb.jar, mail.jar
      • J2SE: jndi.jar
      • Junit: junit.jar


    5. You will need to add these files to your classpath if you want to execute JMX4ODP functions. All the auto-generated start scripts will do this for you.


    6. Edit your build.properties file:

      In your jmx4odp/src/conf directory is the build.properties file, which tells ant about your system and how you want to set up JMX4ODP. It is a standard Java property file, meaning that it is a list of name/value pairs.
          CLASSPATHS
        • j4o_home: the location of the jmx4odp directory.
        • jmxri_classpath: location of the jmxri.jar file.
        • jmxtools_classpath: location of the jmxtools.jar file.
        • jmx_remoting_classpath: location of the jmx_remoting file.
        • xerces_classpath: location of the xerces.jar file.
        • ejb_classpath: location of the ejb.jar file.
        • junit_classpath: location of the junit.jar file.
        • javax_mail_classpath: location of the mail.jar file.

          J4ONet CONFIGURATIONS
        • j4o_html_port: when the startup scripts startup a JMX server, this will be the port that the HTTP adaptor runs on.
        • j4o_remote_port: when the startup scripts startup a JMX server, this will be the port that the RMI connector runs on.
        • j4o_mulitcast_port: the port used by J4ONet to broadcast UDP resolution requests on. Any J4ONet using the same broadcast port will be part of the local J4ONet network.
        • j4o_partner_server_address: if you are starting any of the distributed example servers, then you will need to run another instance of J4ONet on another partner box. This is the IP address of that partner box.
        • j4o_type: the type of box your J4ONet will identify itself as.
        • j4o_rating: the rating that your J4ONet will assign itself.

          MAIL MONITOR DEMO CONFIGURATIONS
        • mm_to_address: when the mail monitor receives an event, this is where it will send the mail to.
        • mm_smtp_address: the address of your SMTP server to send the email through
        • mm_test_url: the mail monitor tests this URL and sends email when it cannot reach it.


        You should make sure that these are all correct. The ports and addresses are probably fine at their defaults. The classpaths, j4o_home, and the j4o_partner_server_address, and mail monitor demo configurations are the ones that will most likely require editing.


      • Edit your InitialJsRegistry.properties file:

        In your jmx4odp/src/conf directory is the InitialJsRegistry.properties file, which is used by org.jmx4odp.j4oNet.InitialJsRegistry to locate the JsRegistry. Unless you changed the j4o_remote_port in the build.properties file, you should not have to make any changes to this file. It too is a list of name value pairs.

        • provider_server: the RMI provider_url of the JMX agent's RMI Connector. This defaults to your loopback.
        • provider_port: the port that the JMX agent's RMI Connector listens on.
        • provider_name: the ObjectName of your JsRegistry MBean.


      • Make your scripts:

        JMX4ODP uses Ant to generate its scripts. Go to your jmx4odp home directory, this should be the same as j4o_home in your build.properties file. Now call the Ant create_scripts task by typing:

        ant create_scripts

        If all is set up properly, this will generate your custom scripts and place them in your jmax4odp/bin directory.

        Now you are done and are ready to go run all the demos that come with this package.