Skip to main content

Error connecting through AppserverConnectionSource

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
deepakpn
Offline
Joined: 2009-08-24

I tried the following on GlassFish Server Open Source Edition 3.1.2.2 (build 5)

AppserverConnectionSource acs = new AppserverConnectionSource(AppserverConnectionSource.PROTOCOL_RMI, "localhost", Integer.parseInt(Settings.JMX_PORT), "admin", _password, null);
MonitoringDottedNames mn = acs.getDomainRoot().getMonitoringDottedNames();

and I get the following exception:

Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: management/rmi-jmx-connector
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:357)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:267)
at com.sun.appserv.management.client.AppserverConnectionSource.createNew(AppserverConnectionSource.java:409)
at com.sun.appserv.management.client.AppserverConnectionSource.getJMXConnector(AppserverConnectionSource.java:472)
at com.sun.appserv.management.client.AppserverConnectionSource.getMBeanServerConnection(AppserverConnectionSource.java:501)
at com.sun.appserv.management.client.ProxyFactory.getInstance(ProxyFactory.java:435)
... 166 more
Caused by: javax.naming.NameNotFoundException: management/rmi-jmx-connector
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:116)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:203)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1924)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1891)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:274)
... 171 more

Is this a bug? Any work-arounds?