- For OC4J, the Service URL specifies the use of the RMI protocol
service:jmx:rmi://[oc4j-host]:[oc4j-ormiport] - For OracleAS, the Service URL additionally specifies the use of the OPMN mechanism to obtain the ORMI port of the specified OC4J instance
service:jmx:rmi:///opmn://[opmn-host]:[opmn-port]/[oc4j-name] - The client needs to be told where to locate the RMI implementation.
For programatic clients, this is done using the environment passed to the JMXConnectorFactory
Hashtable env= new Hashtable();
env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"oracle.oc4j.admin.jmx.remote");
Hashtable credentials= new Hashtable();
credentials.put(JMXConnectorConstant.CREDENTIALS_LOGIN_KEY,"oc4jadmin");
credentials.put(JMXConnectorConstant.CREDENTIALS_PASSWORD_KEY,"welcome1");
env.put(JMXConnector.CREDENTIALS, credentials);
jmxCon = JMXConnectorFactory.newJMXConnector(serviceUrl, env);
For pre-built clients, this is done using a System property:
-Djmx.remote.protocol.provider.pkgs=oracle.oc4j.admin.jmx.remote - The client classpath needs to include the $ORACLE_HOME/j2ee/home/admin_client.jar library. This library contains references to all the libraries needed to establish remote JMX connections in its Manifest.mf Class-Path entry. It's a nice one-stop shop.
The OC4J J2EE Developer's Guide has a good section on remote connections.
3 comments:
Hi Buttso,
Thanks for the blog. It really helped me to resolve JMX Connection issue. Keep up on blogging with some more gooddies.
Thanks again.
Rajesh
Thanks Rajesh, I'm glad it was able to help you.
-buttso-
Sending a big thanks from Melbourne :). the blog covers points which is not clear or may be does not exist in Oracle documentation. Thanks again, cheeers
Post a Comment