dev@glassfish.java.net

Re: I am trying to use amx and gf 3 but it return exception

From: llc <lloyd.chambers_at_Sun.COM>
Date: Mon, 15 Dec 2008 13:53:44 -0800 (PST)

I'm sorry but that code is not working in V3 Prelude.

You can use generic JMX code to connect, please use the following method:

  MBeanServerConnection getMBeanServerConnection(final String host, final
int port)
            throws MalformedURLException, IOException {
        final String urlStr = "service:jmx:rmi:///jndi/rmi://" + host + ":"
+ port + "/jmxrmi";
            
            final JMXServiceURL url = new JMXServiceURL(urlStr);
            
        final JMXConnector jmxConn = JMXConnectorFactory.connect(url);
            final MBeanServerConnection conn = jmxConn.getMBeanServerConnection();
            return conn;
    }

...

import com.sun.appserv.management.client.ProxyFactory;
final MBeanServerConnection conn = getMBeanServerConnection( "localhost",
8686 );
final DomainRoot domainRoot =
ProxyFactory.getInstance(conn).getDomainRoot();
-- 
View this message in context: http://www.nabble.com/I-am-trying-to-use-amx-and-gf-3-but-it-return-exception-tp21022318p21022893.html
Sent from the java.net - glassfish dev mailing list archive at Nabble.com.