My Name is Bastian.
I try to connect to the JBoss Application-Server to read out it's MBeans.
I tried the "2.3.2. Connecting to JMX Using RMI" chapter in the Admin-Guide.
It works, but I am not satisfied.
I have several Questions to this:
1. If I want to use this programm and change it, outside the example-context with the build.xml file I have to build it, take the resources-Directory (with the property, and policy-Files inside) and use it in my classpath to be able to start and use the application in my Eclipse IDE.
I am not confident with these property and policy-Files. I don't even know why they are there, because I have never seen something comparable on the other App-Servers I tried to connect.
How can I use the
InitialContext ic = new InitialContext(); RMIAdaptor server = (RMIAdaptor) ic.lookup("jmx/invoker/RMIAdaptor");
out of the box, without using the property-Files out of the Example.
I haven't even found a word about these files in the Admin-Guide... It just says: "Start the application like that and it will run..."
2. So well: With a lot of work I am able to run the Example-Application in my IDE an try to get some MBean Information...
ObjectName theName = new ObjectName("jboss.jca:name=DefaultDS,service=ManagedConnectionFactory"); MBeanInfo infor = server.getMBeanInfo(theName);
getting the Exception:
java.lang.reflect.UndeclaredThrowableException at $Proxy0.invoke(Unknown Source) at test.myIndipendend.main(myIndipendend.java:101) Caused by: java.io.NotSerializableException: org.jboss.mx.server.registry.MBeanEntry at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) ...
Some other ObjectName work as wanted! It is only on several Classes, that it does not work.
As someone told me this is because of JMX 1.0, which has not implemented the Serialize-Interface for Remote calls.
So my questions:
- Is this right?
- How can I access ALL Mbeans? It must be possible, as the JMX-Console does not seem to have problems with it.