-
1. Re: Non-proprietary connection to JBoss JMX MBeanServer
genman Aug 31, 2004 7:31 PM (in response to ronchalant)
Look on the Wiki. You can get a javax.management.MBeanServer which wraps the calls to the RMI adaptor. -
2. Re: Non-proprietary connection to JBoss JMX MBeanServer
ronchalant Sep 1, 2004 10:41 AM (in response to ronchalant)Yeah but I still need to use propriety code. I can't just gain a connection to a JBoss MBeanServer using a JMXConnector (which would require a JMXConnectorServer to be running somewhere).
What I've started to try and do now is creating a JBoss-specific MBean that is a JMXConnectorServer essentially. I'd like to use the jmxmp protocol, but it doesn't seem that JBoss supports this.
It seems like JBoss doesn't make it very easy to get a connection to their MBeanServer without using any of their code or libs. I don't want to be tied to JBoss though. -
3. Re: Non-proprietary connection to JBoss JMX MBeanServer
ronchalant Sep 1, 2004 11:15 AM (in response to ronchalant)I've actually found a way to do it. I extended the org.jboss.system.ServiceMBeanSupport class and in it I created a JMXConnectorServer. I used the JMXMP protocol, and it was failing before not because JBoss doesn't support it, but because I need to include the jmxremote_optional.jar file in my deployment lib directory.
Now I can create a JMXConnector object to connect directly to the JMXConnectorMBean, which will give me non-proprietary remote access to my MBeans on the MBeanServer. -
4. Re: Non-proprietary connection to JBoss JMX MBeanServer
raja05 Sep 2, 2004 12:50 AM (in response to ronchalant)You could use the HTTPAdaptor as well. You probably need to tweak ur url to pass in arguments and stuff but thats definitely a workable solution.
Whatever u view through the jmx-console uses the HTTPAdaptor to do its work. -
5. Re: Non-proprietary connection to JBoss JMX MBeanServer
ronchalant Sep 7, 2004 10:11 AM (in response to ronchalant)I could use the HTTPAdaptor, but it would only work for JBoss. I wanted to use a method that's not proprietary to any particular appserver. Creating a JMXConnectorServer and running it as a bean still requires some JBoss specific implementation, but it still provides a design for allowing remote management of MBeans by providing a generic, non-proprietary connection to the MBeanServer.
-
6. Re: Non-proprietary connection to JBoss JMX MBeanServer
hengels Jan 3, 2005 9:11 AM (in response to ronchalant)Could you please send me your code? I tried to do the same, but I keep getting ClassCastExceptions during:
JMXConnector connector = JMXConnectorFactory.connect(url);
This is my binding code:JMXServiceURL url = new JMXServiceURL("rmi", null, 0); connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, getServer()); connectorServer.start(); bind(jndiName, connectorServer.toJMXConnector(null));
JndiView shows:+- JMXConnectorServer (class: javax.management.remote.rmi.RMIConnector)
The exception:java.lang.ClassCastException org.concern.ControllerException: java.lang.ClassCastException at org.concern.j2ee.client.JMXConnector.connect(JMXConnector.java:43) at org.concern.j2ee.client.commandline.Concern.getController(Concern.java:80) at org.concern.j2ee.client.commandline.Concern.main(Concern.java:53) Caused by: java.lang.ClassCastException at javax.management.remote.rmi.RMIConnector.narrowJRMPServer(RMIConnector.java:1818) at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1813) at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1777) at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:259) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:207) at org.concern.j2ee.client.JMXConnector.connect(JMXConnector.java:36) ... 2 more
thanks in advance,
Holger -
7. Re: Non-proprietary connection to JBoss JMX MBeanServer
hengels Jan 3, 2005 12:10 PM (in response to ronchalant)"hengels" wrote:
This is my binding code:JMXServiceURL url = new JMXServiceURL("rmi", null, 0); connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, getServer()); connectorServer.start(); bind(jndiName, connectorServer.toJMXConnector(null));
Found out myself. The binding was wrong. Don't put the jmx connector into jndi but the javax.management.remote.rmi.RMIServer:JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/JMXConnectorServer"); connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, getServer()); connectorServer.start();
-
8. Re: Non-proprietary connection to JBoss JMX MBeanServer
ohadr Oct 18, 2009 12:42 PM (in response to ronchalant)hi
did u get the code? i am interested as well...
im trying to do the same...
btw - onchalant - how did u handle WebSphere?
thanks
ohad