admin@glassfish.java.net

Re: [AMX] Problem getting domainRoot

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Fri, 04 Apr 2008 13:30:15 -0700

Shalini,

RMI is not yet supported in V3, and AppserverConnectionSource has not
been updated to support JMXMP, which is currently the only connector.

Use JMXMP with the ServiceURL reported by http://localhost:8080/__asadmin/amx

eg
url = new JMXServiceURL( "service:jmx:jmxmp://localhost:8888" );
JMXConnector jmxConn = JMXConnectorFactory.connect( url, null );
MBeanServerConnection conn = jmxConn.getMBeanServerConnection();

The URL is now reported in the server log at startup (well, once I
commit my changes).

Lloyd

On Apr 3, 2008, at 10:17 PM, Shalini Muthukrishnan wrote:
> Hi Lloyd,
>
> I am trying to use the AMX API to create a connection pool in my
> application in V3.
> All i do is to instantiate the AppserverConnectionSource object with
> appropriate parameters and then call the getDomainRoot() method on
> this object. Deploying the application and invoking it gives me the
> following error:
>
> java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NameNotFoundException
> com
> .sun
> .appserv
> .management.client.ProxyFactory.getInstance(ProxyFactory.java:459)
> com
> .sun
> .appserv
> .management.client.ProxyFactory.getInstance(ProxyFactory.java:409)
> com
> .sun
> .appserv
> .management
> .client
> .AppserverConnectionSource
> .getDomainRoot(AppserverConnectionSource.java:516)
>
> Am i allowed to do this, as of now, in V3?
>
> Thanks,
> Shalini.

---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc