JMX in Beanshell

View: New views
1 Messages — Rating Filter:   Alert me  

JMX in Beanshell

by chrismith85 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to use a Beanshell script to connect to another program via JMX. The client code works perfectly in Java, and it even works when I create a Beanshell interpreter in my Java program and pass it the code. But running the code directly in Beanshell causes the connection to fail. The code in question looks something like this:

JMXServiceURL url = new JMXServiceURL("jmxmp", host, thePort);
jmxc = JMXConnectorFactory.newJMXConnector(url, null);
jmxc.connect();

Upon execution of the connect(), this exception is thrown:

java.lang.RuntimeException: java.io.IOException: javax.management.remote.message.HandshakeBeginMessage

Can anyone offer any assistance?

Thanks,
Chris