title: How to find the weblogic jmx attributes for a objectname
body: <p>I am writing simple client application to connect to weblogic and list all the libraries that a webapp is depending on.However, I am having difficulty in finding the right attributes for a objectname. For example,</p>
  
  <p>If you look at the below sample code given on oracle.com to connect MBeanServer</p>
  
  <pre><code>public static void initConnection(String hostname, String portString,
    String username, String password) throws IOException,
    MalformedURLException {
  
    String protocol = "t3";
    Integer portInteger = Integer.valueOf(portString);
    int port = portInteger.intValue();
    String jndiroot = "/jndi/";
    String mserver = "weblogic.management.mbeanservers.edit";
  
    JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port,
    jndiroot + mserver);
  
    Hashtable h = new Hashtable();
    h.put(Context.SECURITY_PRINCIPAL, username);
    h.put(Context.SECURITY_CREDENTIALS, password);
    h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
       "weblogic.management.remote");
       connector = JMXConnectorFactory.connect(serviceURL, h);
       connection = connector.getMBeanServerConnection();
  
  
  }
  
  public ObjectName startEditSession() throws Exception {
    // Get the object name for ConfigurationManagerMBean.
    ObjectName cfgMgr = (ObjectName) connection.getAttribute(service,
       "ConfigurationManager");
  
  
  
    // Instruct MBeanServerConnection to invoke
    // ConfigurationManager.startEdit(int waitTime int timeout).
    // The startEdit operation returns a handle to DomainMBean, which is
    // the root of the edit hierarchy.
    ObjectName domainConfigRoot = (ObjectName) 
       connection.invoke(cfgMgr,"startEdit", 
       new Object[] { new Integer(60000),
       new Integer(120000) }, new String[] { "java.lang.Integer",
       "java.lang.Integer" });
    if (domainConfigRoot == null) {
       // Couldn't get the lock
       throw new Exception("Somebody else is editing already");
    }
    return domainConfigRoot;
  
  
  
  
  }
  </code></pre>
  
  <p>The line <br><br>
  ObjectName cfgMgr = (ObjectName) connection.getAttribute(service,
           "<strong>ConfigurationManager</strong>");</p>
  
  <p>Is referring to a JMX attribute <strong>ConfigurationManger</strong>. How can we find all the attributes that are under a given objectname in weblogic?</p>
  
  <p>Thanks for your help!!</p>