Hi folks,

I'm trying to get the HTTP JMX adapter to work in James, but so far
with little success. Here's the steps that I did:

* I added -Djavax.management.builder.initial=mx4j.server.MX4JMBeanServerBuilder
to the RUN_CMD in phoenix.sh, so that Java uses MX4J as the MBean
server instead of its own. This works as an echo $RUN_CMD in this
shell script shows:

Running Phoenix:
/usr/lib/jvm/java-1.5.0-sun/bin/java -classpath
:/usr/local/lib/james-2.3.0/bin/lib/:/usr/local/lib/james-2.3.0/lib/
-Djava.ext.dirs=/usr/local/lib/james-2.3.0/lib:/usr/local/lib/james-2.3.0/tools/lib
-Djava.security.manager
-Djava.security.policy=jar:file:/usr/local/lib/james-2.3.0/bin/phoenix-loader.jar!/META-INF/java.policy
-Djavax.management.builder.initial=mx4j.server.MX4JMBeanServerBuilder
-Dphoenix.home=/usr/local/lib/james-2.3.0
-Djava.io.tmpdir=/usr/local/lib/james-2.3.0/temp -jar
/usr/local/lib/james-2.3.0/bin/phoenix-loader.jar


* I enabled the MX4J JMX configuration (both HTTP and RMI) in
kernel.xml as explained in http://wiki.apache.org/james/ConfigureJmx .

However, I get a ClassNotFoundException from MX4J:

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)


Apparently, the classloader that MX4J uses (which is one that Phoenix
provides ?) cannot find mx4j-tools.jar. So I decided to put the MX4J
also in ext as well as into the lib folder in the james.sar, but to no
avail. Adding MX4J to the system classpath didn't help either.

I also downloaded MX4J 3.0.1 and copied its jars (except examples)
into both lib and bin/lib, but that did not change the exception.

I would really appreciate any hints or suggestions as to how to get
this to work !

cheers,
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to