loom
  1. loom
  2. LOOM-78

Make loom jdk1.5 compatible.

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      All
    • Number of attachments :
      2

      Description

      Loom can run under jdk1.5 if compiled with 1.4, but not all parts work correctly. At least the Admin GUI chokes if turned on.

      If building with jdk1.5 some testcases fail with a VerifyError. Same thing happens if running a 1.5 compiled version.

      All tests where done with the HelloWorld demo.

        Activity

        Hide
        Johan Sjoberg added a comment -

        The MX4J problem seems to be because JMX is now standard in jdk1.5.

        Show
        Johan Sjoberg added a comment - The MX4J problem seems to be because JMX is now standard in jdk1.5.
        Hide
        Melvin Dave P. Vivas added a comment -

        I got this stacktrace. It seems that it has the classholder has a problem loading the MX4J libraries. Here's my environment:

        OS - Gentoo Linux
        Java VM - JDK 5.0

        I already tried tweaking with the classpath but it still doesn't work.

        >>>>
        Using LOOM_HOME: /home/donvito/apps/java/loom-1.0-rc3-bin
        Using LOOM_TMPDIR: /home/donvito/apps/java/loom-1.0-rc3-bin/temp
        Using LOOM_ENDORSED: /home/donvito/apps/java/loom-1.0-rc3-bin/lib/endorsed
        Using JAVA_HOME: /home/donvito/apps/java/jdk1.5.0_01
        Using JVM_EXT_DIRS: /home/donvito/apps/java/loom-1.0-rc3-bin/lib:/home/donvito/apps/java/loom-1.0-rc3-bin/tools/lib
        Running Loom:

        Loom Engine 1.0-rc3

        There was an uncaught exception:
        ---------------------------------------------------------
        — Message —
        The MBean class could not be loaded by the context classloader
        — Stack Trace —
        java.lang.ClassNotFoundException: mx4j/adaptor/http/HttpAdaptor
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:429)
        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:354)
        ---------------------------------------------------------

        The log file may contain further details of error.
        Please check the configuration files and restart Loom.
        If the problem persists, contact the Loom project. See
        http://loom.codehaus.org/ for more information.
        Shutting down Loom.
        Logging Error: Writing event to closed stream.
        Logging Error: Writing event to closed stream.

        Show
        Melvin Dave P. Vivas added a comment - I got this stacktrace. It seems that it has the classholder has a problem loading the MX4J libraries. Here's my environment: OS - Gentoo Linux Java VM - JDK 5.0 I already tried tweaking with the classpath but it still doesn't work. >>>> Using LOOM_HOME: /home/donvito/apps/java/loom-1.0-rc3-bin Using LOOM_TMPDIR: /home/donvito/apps/java/loom-1.0-rc3-bin/temp Using LOOM_ENDORSED: /home/donvito/apps/java/loom-1.0-rc3-bin/lib/endorsed Using JAVA_HOME: /home/donvito/apps/java/jdk1.5.0_01 Using JVM_EXT_DIRS: /home/donvito/apps/java/loom-1.0-rc3-bin/lib:/home/donvito/apps/java/loom-1.0-rc3-bin/tools/lib Running Loom: Loom Engine 1.0-rc3 There was an uncaught exception: --------------------------------------------------------- — Message — The MBean class could not be loaded by the context classloader — Stack Trace — java.lang.ClassNotFoundException: mx4j/adaptor/http/HttpAdaptor at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:429) 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:354) --------------------------------------------------------- The log file may contain further details of error. Please check the configuration files and restart Loom. If the problem persists, contact the Loom project. See http://loom.codehaus.org/ for more information. Shutting down Loom. Logging Error: Writing event to closed stream. Logging Error: Writing event to closed stream.
        Hide
        Melvin Dave P. Vivas added a comment -

        Here's the stacktrace from loom.log...

        INFO 2005-03-04 11:09:21.872 [Loom ] (): Logger started
        WARN 2005-03-04 11:09:21.910 [Loom ] (): Container was not started by the daemon thus it will not be possible to restart the JVM via the Management interface.
        ERROR 2005-03-04 11:09:22.121 [Loom ] (): There was a fatal error while starting Embeddor.
        javax.management.ReflectionException: The MBean class could not be loaded by the context classloader
        at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:432)
        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:354)
        at org.codehaus.loom.components.manager.MX4JSystemManager.startHttpAdaptor(MX4JSystemManager.java:227)
        at org.codehaus.loom.components.manager.MX4JSystemManager.initialize(MX4JSystemManager.java:198)
        at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119)
        at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponent(DefaultEmbeddor.java:501)
        at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponents(DefaultEmbeddor.java:480)
        at org.codehaus.loom.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:219)
        at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119)
        at org.codehaus.loom.frontends.CLIMain.startup(CLIMain.java:291)
        at org.codehaus.loom.frontends.CLIMain.execute(CLIMain.java:225)
        at org.codehaus.loom.frontends.CLIMain.main(CLIMain.java:207)
        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.codehaus.loom.launcher.Main.startup(Main.java:185)
        at org.codehaus.loom.launcher.Main.main(Main.java:117)
        Caused by: java.lang.ClassNotFoundException: mx4j/adaptor/http/HttpAdaptor
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:429)
        ... 20 more
        ERROR 2005-03-04 11:09:22.174 [Loom ] (): The MBean class could not be loaded by the context classloader
        javax.management.ReflectionException: The MBean class could not be loaded by the context classloader
        at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:432)
        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:354)
        at org.codehaus.loom.components.manager.MX4JSystemManager.startHttpAdaptor(MX4JSystemManager.java:227)
        at org.codehaus.loom.components.manager.MX4JSystemManager.initialize(MX4JSystemManager.java:198)
        at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119)
        at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponent(DefaultEmbeddor.java:501)
        at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponents(DefaultEmbeddor.java:480)
        at org.codehaus.loom.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:219)
        at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119)
        at org.codehaus.loom.frontends.CLIMain.startup(CLIMain.java:291)
        at org.codehaus.loom.frontends.CLIMain.execute(CLIMain.java:225)
        at org.codehaus.loom.frontends.CLIMain.main(CLIMain.java:207)
        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.codehaus.loom.launcher.Main.startup(Main.java:185)
        at org.codehaus.loom.launcher.Main.main(Main.java:117)
        Caused by: java.lang.ClassNotFoundException: mx4j/adaptor/http/HttpAdaptor
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:429)
        ... 20 more

        Show
        Melvin Dave P. Vivas added a comment - Here's the stacktrace from loom.log... INFO 2005-03-04 11:09:21.872 [Loom ] (): Logger started WARN 2005-03-04 11:09:21.910 [Loom ] (): Container was not started by the daemon thus it will not be possible to restart the JVM via the Management interface. ERROR 2005-03-04 11:09:22.121 [Loom ] (): There was a fatal error while starting Embeddor. javax.management.ReflectionException: The MBean class could not be loaded by the context classloader at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:432) 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:354) at org.codehaus.loom.components.manager.MX4JSystemManager.startHttpAdaptor(MX4JSystemManager.java:227) at org.codehaus.loom.components.manager.MX4JSystemManager.initialize(MX4JSystemManager.java:198) at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119) at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponent(DefaultEmbeddor.java:501) at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponents(DefaultEmbeddor.java:480) at org.codehaus.loom.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:219) at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119) at org.codehaus.loom.frontends.CLIMain.startup(CLIMain.java:291) at org.codehaus.loom.frontends.CLIMain.execute(CLIMain.java:225) at org.codehaus.loom.frontends.CLIMain.main(CLIMain.java:207) 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.codehaus.loom.launcher.Main.startup(Main.java:185) at org.codehaus.loom.launcher.Main.main(Main.java:117) Caused by: java.lang.ClassNotFoundException: mx4j/adaptor/http/HttpAdaptor at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:429) ... 20 more ERROR 2005-03-04 11:09:22.174 [Loom ] (): The MBean class could not be loaded by the context classloader javax.management.ReflectionException: The MBean class could not be loaded by the context classloader at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:432) 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:354) at org.codehaus.loom.components.manager.MX4JSystemManager.startHttpAdaptor(MX4JSystemManager.java:227) at org.codehaus.loom.components.manager.MX4JSystemManager.initialize(MX4JSystemManager.java:198) at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119) at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponent(DefaultEmbeddor.java:501) at org.codehaus.loom.components.embeddor.DefaultEmbeddor.setupComponents(DefaultEmbeddor.java:480) at org.codehaus.loom.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:219) at org.codehaus.dna.impl.ContainerUtil.initialize(ContainerUtil.java:119) at org.codehaus.loom.frontends.CLIMain.startup(CLIMain.java:291) at org.codehaus.loom.frontends.CLIMain.execute(CLIMain.java:225) at org.codehaus.loom.frontends.CLIMain.main(CLIMain.java:207) 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.codehaus.loom.launcher.Main.startup(Main.java:185) at org.codehaus.loom.launcher.Main.main(Main.java:117) Caused by: java.lang.ClassNotFoundException: mx4j/adaptor/http/HttpAdaptor at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.loadClass(MBeanInstantiatorImpl.java:429) ... 20 more
        Hide
        Simon Goldsmith added a comment -

        If all you want is a 1.5 compatable phoenix-4.0.4 server I have attached a version here (unzip into your phoenix install in $PHOENIX_HOME/bin) and change the java startup line in the phoenix.sh script to have -Djavax.management.builder.initial=mx4j.server.MX4JMBeanServerBuilder in the startup of the JVM. You also need to download the mx4j-2.1.1 from sourceforge and install mx4j jars into $PHOENIX_HOME/bin/lib as well. There are several jars in the mx4j pkg whereas the old one had only 2. The final $PHOENIX_HOME/bin/lib should look like this:

        rw-r---- 1 ****** ******_grp 96673 Aug 16 13:51 mx4j-examples.jar
        rw-r---- 1 ****** ******_grp 148213 Aug 16 13:51 mx4j-impl.jar
        rw-r---- 1 ****** ******_grp 261174 Aug 16 13:51 mx4j-jmx.jar
        rw-r---- 1 ****** ******_grp 167410 Aug 16 13:51 mx4j-remote.jar
        rw-r---- 1 ****** ******_grp 94716 Aug 16 13:51 mx4j-rimpl.jar
        rw-r---- 1 ****** ******_grp 73072 Aug 16 13:51 mx4j-rjmx.jar
        rw-r---- 1 ****** ******_grp 2249058 Aug 16 13:51 mx4j-soap.war
        rw-r---- 1 ****** ******_grp 485831 Aug 16 13:51 mx4j-tools.jar
        rw-r---- 1 ****** ******_grp 409009 Aug 16 13:51 mx4j.jar
        rw-r---- 1 ****** ******_grp 144291 Aug 16 13:51 phoenix-engine.jar

        Show
        Simon Goldsmith added a comment - If all you want is a 1.5 compatable phoenix-4.0.4 server I have attached a version here (unzip into your phoenix install in $PHOENIX_HOME/bin) and change the java startup line in the phoenix.sh script to have -Djavax.management.builder.initial=mx4j.server.MX4JMBeanServerBuilder in the startup of the JVM. You also need to download the mx4j-2.1.1 from sourceforge and install mx4j jars into $PHOENIX_HOME/bin/lib as well. There are several jars in the mx4j pkg whereas the old one had only 2. The final $PHOENIX_HOME/bin/lib should look like this: rw-r ---- 1 ****** ******_grp 96673 Aug 16 13:51 mx4j-examples.jar rw-r ---- 1 ****** ******_grp 148213 Aug 16 13:51 mx4j-impl.jar rw-r ---- 1 ****** ******_grp 261174 Aug 16 13:51 mx4j-jmx.jar rw-r ---- 1 ****** ******_grp 167410 Aug 16 13:51 mx4j-remote.jar rw-r ---- 1 ****** ******_grp 94716 Aug 16 13:51 mx4j-rimpl.jar rw-r ---- 1 ****** ******_grp 73072 Aug 16 13:51 mx4j-rjmx.jar rw-r ---- 1 ****** ******_grp 2249058 Aug 16 13:51 mx4j-soap.war rw-r ---- 1 ****** ******_grp 485831 Aug 16 13:51 mx4j-tools.jar rw-r ---- 1 ****** ******_grp 409009 Aug 16 13:51 mx4j.jar rw-r ---- 1 ****** ******_grp 144291 Aug 16 13:51 phoenix-engine.jar
        Hide
        Simon Goldsmith added a comment -

        file attached to go with phoenix-4.0,4 java 1.5 comment

        Show
        Simon Goldsmith added a comment - file attached to go with phoenix-4.0,4 java 1.5 comment
        Hide
        Johan Sjoberg added a comment -

        Simon, thanks for the info! I'll take a look and see what we can do.

        Show
        Johan Sjoberg added a comment - Simon, thanks for the info! I'll take a look and see what we can do.
        Hide
        Simon Goldsmith added a comment -

        Here's yet another version of the phoenix-engine.jar. I noticed that the MX4J now implements the JSR160 inspired cacheing of operations and unfortunately the phoenix code has this in the org.apache.avalon.phoenix.components.manager.MBeanInfoBuilder class:

        private ModelMBeanOperationInfo buildOperationInfo( final MethodDescriptor method,
        final Configuration config )
        throws ConfigurationException

        { .... // TODO: might want to make this configurable. It controls the caching behavior // of the invoke results. MX4J appears to cache this per operation regardless // of what the invoke parameters are *SIGH* - PR descriptor.setField( "currencyTimeLimit", new Integer( 0 ) ); .... }

        which now works according to the JSR160 spec and means that previously you would always get the Managed Object for a JMX Bean being invoked by phoenix when you invoked an MX4j "operation", but by upgrading to MX4j2.1.1 mean that it will call it once then cache the result forever, never calling your code again if you invoke it again in the future. I have recompiled with the last line above (descriptor.setField...) commented out and phoenix behaves as before. Just use the attached jar and replace $PHOENIX_HOME/bin/lib/phoenix-engine.jar. Really you should be able to set this using an attribute on the operation using the mx-attribute tag, but phoenix doesn't process these on operations only on topics (blocks).

        Hope that is helpful - not confusing!

        simon

        Show
        Simon Goldsmith added a comment - Here's yet another version of the phoenix-engine.jar. I noticed that the MX4J now implements the JSR160 inspired cacheing of operations and unfortunately the phoenix code has this in the org.apache.avalon.phoenix.components.manager.MBeanInfoBuilder class: private ModelMBeanOperationInfo buildOperationInfo( final MethodDescriptor method, final Configuration config ) throws ConfigurationException { .... // TODO: might want to make this configurable. It controls the caching behavior // of the invoke results. MX4J appears to cache this per operation regardless // of what the invoke parameters are *SIGH* - PR descriptor.setField( "currencyTimeLimit", new Integer( 0 ) ); .... } which now works according to the JSR160 spec and means that previously you would always get the Managed Object for a JMX Bean being invoked by phoenix when you invoked an MX4j "operation", but by upgrading to MX4j2.1.1 mean that it will call it once then cache the result forever, never calling your code again if you invoke it again in the future. I have recompiled with the last line above (descriptor.setField...) commented out and phoenix behaves as before. Just use the attached jar and replace $PHOENIX_HOME/bin/lib/phoenix-engine.jar. Really you should be able to set this using an attribute on the operation using the mx-attribute tag, but phoenix doesn't process these on operations only on topics (blocks). Hope that is helpful - not confusing! simon
        Hide
        Johan Sjoberg added a comment -

        Loom doesn't compile with version 2.1.1 or 3.0.1 of MX4J due to missing imports in MX4JSystemManager [1]. Is there an easy migration path from 1.1 to 2.1.1 or 3.0.1, that would keep the RMI functionality?

        1 http://cvs.loom.codehaus.org/loom/engine/src/java/org/codehaus/loom/components/manager/MX4JSystemManager.java?rev=1.4&view=markup

        Show
        Johan Sjoberg added a comment - Loom doesn't compile with version 2.1.1 or 3.0.1 of MX4J due to missing imports in MX4JSystemManager [1] . Is there an easy migration path from 1.1 to 2.1.1 or 3.0.1, that would keep the RMI functionality? 1 http://cvs.loom.codehaus.org/loom/engine/src/java/org/codehaus/loom/components/manager/MX4JSystemManager.java?rev=1.4&view=markup
        Hide
        Johan Sjoberg added a comment -

        MX4J 3.0.1 and the HTTP GUI now works with cvs-head. One jar is missing though, the tools jar. Currently it needs to added by hand. For some reason it has not been uploaded to ibiblio.

        Show
        Johan Sjoberg added a comment - MX4J 3.0.1 and the HTTP GUI now works with cvs-head. One jar is missing though, the tools jar. Currently it needs to added by hand. For some reason it has not been uploaded to ibiblio.

          People

          • Assignee:
            Unassigned
            Reporter:
            Johan Sjoberg
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: