Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 3.0-beta3
    • Component/s: James Core
    • Labels:
      None
    • Environment:
      Linux Ubuntu 6.06 (Dapper Drake), JDK 1.5.0_06-b05, James 2.3.0 final binary release

      Description

      I downloaded the binary James 2.3.0 final release and modified the kernel.xml according to http://wiki.apache.org/james/ConfigureJmx, section Enabling James' built-in MBeanServer. This gives me an exception

      java.lang.ClassNotFoundException: mx4j/tools/naming/NamingService
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:164)
      at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:437)
      at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.findClass(MBeanInstantiatorImpl.java:72)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:279)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:227)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:463)
      at org.apache.avalon.phoenix.components.manager.MX4JSystemManager.startRMIAdaptor(MX4JSystemManager.java:248)
      at org.apache.avalon.phoenix.components.manager.MX4JSystemManager.initialize(MX4JSystemManager.java:167)
      at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:244)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.setupComponent(DefaultEmbeddor.java:575)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.setupComponents(DefaultEmbeddor.java:551)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:244)
      at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:244)
      at org.apache.avalon.phoenix.frontends.CLIMain.startup(CLIMain.java:234)
      at org.apache.avalon.phoenix.frontends.CLIMain.execute(CLIMain.java:162)
      at org.apache.avalon.phoenix.frontends.CLIMain.main(CLIMain.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.avalon.phoenix.launcher.Main.startup(Main.java:128)
      at org.apache.avalon.phoenix.launcher.Main.main(Main.java:83)

      Without JMX enabled, James starts just fine.
      Copying the jars from the current MX4J release (3.0.1) into lib and bin/lib directories does not help.
      Neither does configuring MX4J as the default MBean server via adding -Djavax.management.builder.initial=mx4j.server.MX4JMBeanServerBuilder
      to the RUN_CMD in phoenix.sh (as suggested e.g. in http://jira.codehaus.org/browse/LOOM-78). This changes the exception to:

      java.lang.ClassNotFoundException: mx4j.adaptor.http.HttpAdaptor
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at mx4j.server.interceptor.InvokerMBeanServerInterceptor.instantiate(InvokerMBeanServerInterceptor.java:99)
      at mx4j.server.interceptor.DefaultMBeanServerInterceptor.instantiate(DefaultMBeanServerInterceptor.java:105)
      at mx4j.server.interceptor.SecurityMBeanServerInterceptor.instantiate(SecurityMBeanServerInterceptor.java:72)
      at mx4j.server.interceptor.DefaultMBeanServerInterceptor.instantiate(DefaultMBeanServerInterceptor.java:105)
      at mx4j.server.interceptor.DefaultMBeanServerInterceptor.instantiate(DefaultMBeanServerInterceptor.java:105)
      at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.instantiate(ContextClassLoaderMBeanServerInterceptor.java:136)
      at mx4j.server.MX4JMBeanServer.instantiateImpl(MX4JMBeanServer.java:681)
      at mx4j.server.MX4JMBeanServer.createMBean(MX4JMBeanServer.java:743)
      at mx4j.server.MX4JMBeanServer.createMBean(MX4JMBeanServer.java:733)
      at org.apache.avalon.phoenix.components.manager.MX4JSystemManager.startHttpAdaptor(MX4JSystemManager.java:191)
      at org.apache.avalon.phoenix.components.manager.MX4JSystemManager.initialize(MX4JSystemManager.java:162)
      at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:244)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.setupComponent(DefaultEmbeddor.java:575)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.setupComponents(DefaultEmbeddor.java:551)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:244)
      at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:244)
      at org.apache.avalon.phoenix.frontends.CLIMain.startup(CLIMain.java:234)
      at org.apache.avalon.phoenix.frontends.CLIMain.execute(CLIMain.java:162)
      at org.apache.avalon.phoenix.frontends.CLIMain.main(CLIMain.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.avalon.phoenix.launcher.Main.startup(Main.java:128)
      at org.apache.avalon.phoenix.launcher.Main.main(Main.java:83)

        Activity

        Hide
        Bernd Fondermann added a comment -

        The problem described here is rather tricky and seems to be an Avalon/Phoenix issue.

        For the time being I suggest as workarounds to use JDK 1.4.2 to be able to enjoy HTTPAdaptor, or switch to another protocol if JDK 1.5 is needed.

        I will continue trying to understand this. I can observe strange things when debugging Phoenix.

        TBC...

        Show
        Bernd Fondermann added a comment - The problem described here is rather tricky and seems to be an Avalon/Phoenix issue. For the time being I suggest as workarounds to use JDK 1.4.2 to be able to enjoy HTTPAdaptor, or switch to another protocol if JDK 1.5 is needed. I will continue trying to understand this. I can observe strange things when debugging Phoenix. TBC...
        Hide
        Stefano Bagnara added a comment -

        Try to copy the mx4j-tools.jar from phoenix/bin/lib to any other folder that have the mx4j-jmx.jar library.

        Otherwise we could try to upgrade/rebuild phoenix to build against mx4j 3.0.1, I don't know what's new in mx4j 3.0.1 against mx4j 1.1.1 currently used.

        Show
        Stefano Bagnara added a comment - Try to copy the mx4j-tools.jar from phoenix/bin/lib to any other folder that have the mx4j-jmx.jar library. Otherwise we could try to upgrade/rebuild phoenix to build against mx4j 3.0.1, I don't know what's new in mx4j 3.0.1 against mx4j 1.1.1 currently used.
        Hide
        Thomas Dudziak added a comment -

        We cannot run 1.4.2 as the machine hosts other stuff that requires Java 5. And we need the HTTP adaptor to monitor James (it's automatic monitoring relying on HTTP, so RMI won't do).
        The simplest work around of sorts would be that James manually registers the HTTP adaptor (if configured in kernel.xml) with the JDK JMX server. We have this working in other places, so I can provide code for this if necessary.

        Show
        Thomas Dudziak added a comment - We cannot run 1.4.2 as the machine hosts other stuff that requires Java 5. And we need the HTTP adaptor to monitor James (it's automatic monitoring relying on HTTP, so RMI won't do). The simplest work around of sorts would be that James manually registers the HTTP adaptor (if configured in kernel.xml) with the JDK JMX server. We have this working in other places, so I can provide code for this if necessary.
        Hide
        Thomas Dudziak added a comment -

        I did copy all MX4J jars (except examples) to both bin/lib and lib as well as added it to Java's classpath (via RUN_CMD in phoenix.sh), but to no avail.

        Show
        Thomas Dudziak added a comment - I did copy all MX4J jars (except examples) to both bin/lib and lib as well as added it to Java's classpath (via RUN_CMD in phoenix.sh), but to no avail.
        Hide
        Norman Maurer added a comment -

        JMX now works with 3.x and is enabled by default

        Show
        Norman Maurer added a comment - JMX now works with 3.x and is enabled by default

          People

          • Assignee:
            Norman Maurer
            Reporter:
            Thomas Dudziak
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development