Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: OracleAS 10.1.3 problem on accessing MBean from remote Java client

Re: OracleAS 10.1.3 problem on accessing MBean from remote Java client

From: Jimmy <jimmy_please_at_yahoo.com>
Date: 8 Feb 2005 07:28:49 -0800
Message-ID: <1107876529.604614.180190@f14g2000cwb.googlegroups.com>


Oops, wrong arguments for method "getTableNames". Does anyone know where I can get a little more info about the class "oracle.dms.jmx.NamedValue"? And something about "ADML document"? I'm trying to invoke the method of "getTables" and "queryTables".

Thx!

Jimmy wrote:
> Has anyone tried using developer's preview 3? I'm having problem to
> invoke method in AggreMBean. No luck yet find the API for DMS either
> (i.e. need doc on oracle.dms.jmx.NamedValue). The following is the
> exception I'm getting, the descriptions from JMX console and the
simple
> JMX client's code.
>
> >> Exception in thread "main" javax.management.ReflectionException:
The
> method null.getTableNames could not be found
> >> Caused by: java.lang.NoSuchMethodException:
> oracle.dms.jmx.SpyMBean.getTableNames(java.lang.String,
> oracle.dms.jmx.NamedValue, oracle.dms.jmx.NamedValue)
>
> ====================================================================
>
> According to the JMX console ...
>
> Method name
> - getTableNames
> - Gets an array of table names
> Parameters
> contexts
> - oracle.dms.jmx.NamedValue[]
> - a list of name-value pairs containing auxilary information
> for this
> Return type
> - java.lang.String
>
> ====================================================================
>
>
> import java.rmi.RemoteException;
> import java.util.Hashtable;
>
> import javax.ejb.CreateException;
> import javax.management.ObjectName;
> import javax.management.j2ee.Management;
> import javax.management.j2ee.ManagementHome;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.naming.NamingException;
> import javax.rmi.PortableRemoteObject;
>
> import oracle.dms.jmx.NamedValue;
> import oracle.dms.jmx.NamedValueSupport;
>
> public class MyOracleASJMXClient {
> public static void main(String[] args) throws Exception {
> Hashtable env = new Hashtable();
> String url = "ormi://localhost:23791/default";
> env.put(Context.PROVIDER_URL, url);
> env.put(Context.SECURITY_PRINCIPAL, "admin");
> env.put(Context.SECURITY_CREDENTIALS, "welcome");
>
> System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
>
> "com.evermind.server.ApplicationClientInitialContextFactory");
>
> Object hm;
> try {
> Context ctx = new InitialContext(env);
> hm = ctx.lookup("java:comp/env/ejb/mgmt/MEJB");
> } catch (NamingException ne) {
> throw ne;
> }
>
> ManagementHome mgmtHome = (ManagementHome)
> PortableRemoteObject.narrow(
> hm, ManagementHome.class);
>
> try {
> Management mejb = mgmtHome.create();
>
> ObjectName objName = new
> ObjectName("default:type=AggreMBean");
> NamedValue namedValue = new NamedValueSupport("table",
> "oc4j_ejb_method");
> Object retObj = mejb.invoke(objName, "getTableNames", new
> Object[] {
> null, null, null }, new String[] {
> "java.lang.String",
> "oracle.dms.jmx.NamedValue",
> "oracle.dms.jmx.NamedValue" });
>
> } catch (RemoteException re) {
> re.printStackTrace();
> } catch (CreateException ce) {
> ce.printStackTrace();
> }
> }
> }
Received on Tue Feb 08 2005 - 09:28:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US